mirror of
https://github.com/Automattic/harper.git
synced 2025-12-23 08:48:15 +00:00
feat: harper-cli warn setting unknown rules (#2210)
This commit is contained in:
parent
cd92514808
commit
9aba2e4e4e
1 changed files with 7 additions and 1 deletions
|
|
@ -230,12 +230,18 @@ fn main() -> anyhow::Result<()> {
|
|||
linter.set_all_rules_to(Some(false));
|
||||
|
||||
for rule in rules {
|
||||
if !linter.contains_key(&rule) {
|
||||
eprintln!("Warning: Cannot enable unknown rule '{}'.", &rule);
|
||||
}
|
||||
linter.config.set_rule_enabled(rule, true);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(rules) = ignore {
|
||||
for rule in rules {
|
||||
if !linter.contains_key(&rule) {
|
||||
eprintln!("Warning: Cannot disable unknown rule '{}'.", &rule);
|
||||
}
|
||||
linter.config.set_rule_enabled(rule, false);
|
||||
}
|
||||
}
|
||||
|
|
@ -992,7 +998,7 @@ fn load_file(
|
|||
Box::new(comment_parser)
|
||||
} else {
|
||||
println!(
|
||||
"Warning: could not detect language ID; falling back to PlainEnglish parser."
|
||||
"Warning: Could not detect language ID; falling back to PlainEnglish parser."
|
||||
);
|
||||
Box::new(PlainEnglish)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue