Skip to content

Commit 8b9d70d

Browse files
committed
Define modules in lib.rs instead of main.rs
1 parent 09fe163 commit 8b9d70d

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

clippy_dev/src/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clippy_dev::clippy_project_root;
1+
use crate::clippy_project_root;
22
use shell_escape::escape;
33
use std::ffi::OsStr;
44
use std::io;

clippy_dev/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ use std::fs;
99
use std::path::{Path, PathBuf};
1010
use walkdir::WalkDir;
1111

12+
pub mod fmt;
13+
pub mod new_lint;
14+
pub mod stderr_length_check;
15+
pub mod update_lints;
16+
1217
lazy_static! {
1318
static ref DEC_CLIPPY_LINT_RE: Regex = Regex::new(
1419
r#"(?x)

clippy_dev/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ use clippy_dev::{
77
};
88
use std::path::Path;
99

10-
mod fmt;
11-
mod new_lint;
12-
mod stderr_length_check;
10+
use clippy_dev::{fmt, new_lint, stderr_length_check};
1311

1412
#[derive(Clone, Copy, PartialEq)]
1513
enum UpdateMode {

clippy_dev/src/new_lint.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
use clippy_dev::clippy_project_root;
1+
use crate::clippy_project_root;
22
use std::fs::{File, OpenOptions};
33
use std::io;
44
use std::io::prelude::*;
55
use std::io::ErrorKind;
66
use std::path::Path;
77

8+
/// Creates files required to implement and test a new lint and runs `update_lints`.
9+
///
10+
/// # Errors
11+
///
12+
/// This function errors, if the files couldn't be created
813
pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str>) -> Result<(), io::Error> {
914
let pass = pass.expect("`pass` argument is validated by clap");
1015
let lint_name = lint_name.expect("`name` argument is validated by clap");

clippy_dev/src/stderr_length_check.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
use crate::clippy_project_root;
12
use std::ffi::OsStr;
23
use std::fs;
34
use std::path::{Path, PathBuf};
4-
55
use walkdir::WalkDir;
66

7-
use clippy_dev::clippy_project_root;
8-
97
// The maximum length allowed for stderr files.
108
//
119
// We limit this because small files are easier to deal with than bigger files.

0 commit comments

Comments
 (0)