diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs index a6043c4be0d..6ae3f58c1f2 100644 --- a/clippy_dev/src/fmt.rs +++ b/clippy_dev/src/fmt.rs @@ -1,4 +1,4 @@ -use clippy_dev::clippy_project_root; +use crate::clippy_project_root; use shell_escape::escape; use std::ffi::OsStr; use std::io; diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 6fe7bb155ac..83f60f15906 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -9,6 +9,11 @@ use std::fs; use std::path::{Path, PathBuf}; use walkdir::WalkDir; +pub mod fmt; +pub mod new_lint; +pub mod stderr_length_check; +pub mod update_lints; + lazy_static! { static ref DEC_CLIPPY_LINT_RE: Regex = Regex::new( r#"(?x) diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 901e663ded3..222658a628b 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -7,9 +7,7 @@ use clippy_dev::{ }; use std::path::Path; -mod fmt; -mod new_lint; -mod stderr_length_check; +use clippy_dev::{fmt, new_lint, stderr_length_check}; #[derive(Clone, Copy, PartialEq)] enum UpdateMode { diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 9e2a4617cde..44b2a5383d2 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -1,10 +1,15 @@ -use clippy_dev::clippy_project_root; +use crate::clippy_project_root; use std::fs::{File, OpenOptions}; use std::io; use std::io::prelude::*; use std::io::ErrorKind; use std::path::Path; +/// Creates files required to implement and test a new lint and runs `update_lints`. +/// +/// # Errors +/// +/// This function errors, if the files couldn't be created pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str>) -> Result<(), io::Error> { let pass = pass.expect("`pass` argument is validated by clap"); let lint_name = lint_name.expect("`name` argument is validated by clap"); diff --git a/clippy_dev/src/stderr_length_check.rs b/clippy_dev/src/stderr_length_check.rs index c511733f7bf..e02b6f7da5f 100644 --- a/clippy_dev/src/stderr_length_check.rs +++ b/clippy_dev/src/stderr_length_check.rs @@ -1,11 +1,9 @@ +use crate::clippy_project_root; use std::ffi::OsStr; use std::fs; use std::path::{Path, PathBuf}; - use walkdir::WalkDir; -use clippy_dev::clippy_project_root; - // The maximum length allowed for stderr files. // // We limit this because small files are easier to deal with than bigger files.