Skip to main content

marker_ids

Function marker_ids 

Source
pub fn marker_ids(line: &str) -> Vec<String>
Expand description

The skill ids a marker line names, when the line is a comment carrying the marker.

Only a comment line counts — #, // or //! first — so that a test which writes a marker into a fixture, as data, does not bind itself to the skill it writes.

use majordomus_cli::skill::marker_ids;
let marker = concat!("majordomus-", "skill:");
assert_eq!(marker_ids(&format!("# {marker} implement repo-review")), ["implement", "repo-review"]);
assert_eq!(marker_ids(&format!("//! {marker} implement")), ["implement"]);
assert!(marker_ids(&format!("printf '# {marker} x'")).is_empty());