Add clippy as a submodule
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -33,3 +33,6 @@
|
||||
[submodule "src/libcompiler_builtins"]
|
||||
path = src/libcompiler_builtins
|
||||
url = https://github.com/rust-lang-nursery/compiler-builtins
|
||||
[submodule "src/tools/clippy"]
|
||||
path = src/tools/clippy
|
||||
url = https://github.com/rust-lang-nursery/rust-clippy.git
|
||||
|
||||
@@ -248,7 +248,7 @@ impl<'a> Builder<'a> {
|
||||
compile::StartupObjects, tool::BuildManifest, tool::Rustbook, tool::ErrorIndex,
|
||||
tool::UnstableBookGen, tool::Tidy, tool::Linkchecker, tool::CargoTest,
|
||||
tool::Compiletest, tool::RemoteTestServer, tool::RemoteTestClient,
|
||||
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc,
|
||||
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc, tool::Clippy,
|
||||
native::Llvm),
|
||||
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
|
||||
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Linkcheck,
|
||||
|
||||
@@ -340,6 +340,44 @@ impl Step for Cargo {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct Clippy {
|
||||
pub compiler: Compiler,
|
||||
pub target: Interned<String>,
|
||||
}
|
||||
|
||||
impl Step for Clippy {
|
||||
type Output = PathBuf;
|
||||
const DEFAULT: bool = true;
|
||||
const ONLY_HOSTS: bool = true;
|
||||
|
||||
fn should_run(run: ShouldRun) -> ShouldRun {
|
||||
run.path("src/tools/clippy")
|
||||
}
|
||||
|
||||
fn make_run(run: RunConfig) {
|
||||
run.builder.ensure(Clippy {
|
||||
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
|
||||
target: run.target,
|
||||
});
|
||||
}
|
||||
|
||||
fn run(self, builder: &Builder) -> PathBuf {
|
||||
// Clippy depends on procedural macros (serde), which requires a full host
|
||||
// compiler to be available, so we need to depend on that.
|
||||
builder.ensure(compile::Rustc {
|
||||
compiler: self.compiler,
|
||||
target: builder.build.build,
|
||||
});
|
||||
builder.ensure(ToolBuild {
|
||||
compiler: self.compiler,
|
||||
target: self.target,
|
||||
tool: "clippy",
|
||||
mode: Mode::Librustc,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct Rls {
|
||||
pub compiler: Compiler,
|
||||
|
||||
1
src/tools/clippy
Submodule
1
src/tools/clippy
Submodule
Submodule src/tools/clippy added at 7cdaeae1b8
@@ -62,6 +62,7 @@ fn filter_dirs(path: &Path) -> bool {
|
||||
"src/rt/hoedown",
|
||||
"src/tools/cargo",
|
||||
"src/tools/rls",
|
||||
"src/tools/clippy",
|
||||
"src/tools/rust-installer",
|
||||
];
|
||||
skip.iter().any(|p| path.ends_with(p))
|
||||
|
||||
Reference in New Issue
Block a user