about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-03-31 15:09:11 +0200
committerflip1995 <hello@philkrones.com>2020-03-31 17:24:09 +0200
commit8b9d70d3490698dac74f67a9caad1c5ee825e716 (patch)
tree9547305f009f8a75ef3e91e32fc7a68e3299dc52
parent09fe163c9290b8aa573decb25d5b4b02f33e481e (diff)
downloadrust-8b9d70d3490698dac74f67a9caad1c5ee825e716.tar.gz
rust-8b9d70d3490698dac74f67a9caad1c5ee825e716.zip
Define modules in lib.rs instead of main.rs
-rw-r--r--clippy_dev/src/fmt.rs2
-rw-r--r--clippy_dev/src/lib.rs5
-rw-r--r--clippy_dev/src/main.rs4
-rw-r--r--clippy_dev/src/new_lint.rs7
-rw-r--r--clippy_dev/src/stderr_length_check.rs4
5 files changed, 14 insertions, 8 deletions
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.