Define modules in lib.rs instead of main.rs
This commit is contained in:
parent
09fe163c92
commit
8b9d70d349
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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 {
|
||||
|
@ -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");
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user