+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
+
use std::ffi::OsStr;
use std::path::PathBuf;
fn new(path: PathBuf) -> Self {
let content: String = std::fs::read_to_string(&path).unwrap();
// we don't want the first letter after "error: ", "help: " ... to be capitalized
- // also no puncutation (except for "?" ?) at the end of a line
+ // also no punctuation (except for "?" ?) at the end of a line
let regex_set: RegexSet = RegexSet::new(&[
r"error: [A-Z]",
r"help: [A-Z]",
// make sure that lint messages:
// * are not capitalized
- // * don't have puncuation at the end of the last sentence
+ // * don't have punctuation at the end of the last sentence
// these directories have interesting tests
let test_dirs = ["ui", "ui-cargo", "ui-internal", "ui-toml"]
.filter(|message| !message.bad_lines.is_empty())
.collect();
- bad_tests.iter().for_each(|message| {
+ for message in &bad_tests {
eprintln!(
"error: the test '{}' contained the following nonconforming lines :",
message.path.display()
);
message.bad_lines.iter().for_each(|line| eprintln!("{}", line));
eprintln!("\n\n");
- });
+ }
eprintln!(
"\n\n\nLint message should not start with a capital letter and should not have punctuation at the end of the message unless multiple sentences are needed."