-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make clippy a subrepo #70650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make clippy a subrepo #70650
Changes from 8 commits
189051f
d98f323
5cd8586
2b6fd4c
bf24f9b
f8135b0
253519c
b6a2745
3877e33
9aff67d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1330,7 +1330,7 @@ pub struct Clippy { | |
} | ||
|
||
impl Step for Clippy { | ||
type Output = Option<PathBuf>; | ||
type Output = PathBuf; | ||
const ONLY_HOSTS: bool = true; | ||
|
||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { | ||
|
@@ -1348,7 +1348,7 @@ impl Step for Clippy { | |
}); | ||
} | ||
|
||
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> { | ||
fn run(self, builder: &Builder<'_>) -> PathBuf { | ||
let compiler = self.compiler; | ||
let target = self.target; | ||
assert!(builder.config.extended); | ||
|
@@ -1368,16 +1368,10 @@ impl Step for Clippy { | |
// state for clippy isn't testing. | ||
let clippy = builder | ||
.ensure(tool::Clippy { compiler, target, extra_features: Vec::new() }) | ||
.or_else(|| { | ||
missing_tool("clippy", builder.build.config.missing_tools); | ||
None | ||
})?; | ||
.expect("clippy expected to build - essential tool"); | ||
let cargoclippy = builder | ||
.ensure(tool::CargoClippy { compiler, target, extra_features: Vec::new() }) | ||
.or_else(|| { | ||
missing_tool("cargo clippy", builder.build.config.missing_tools); | ||
None | ||
})?; | ||
.expect("clippy expected to build - essential tool"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kinda, you can still turn it off to not include it in the dist |
||
|
||
builder.install(&clippy, &image.join("bin"), 0o755); | ||
builder.install(&cargoclippy, &image.join("bin"), 0o755); | ||
|
@@ -1416,7 +1410,7 @@ impl Step for Clippy { | |
builder.info(&format!("Dist clippy stage{} ({})", compiler.stage, target)); | ||
let _time = timeit(builder); | ||
builder.run(&mut cmd); | ||
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target))) | ||
distdir(builder).join(format!("{}-{}.tar.gz", name, target)) | ||
} | ||
} | ||
|
||
|
@@ -1683,7 +1677,7 @@ impl Step for Extended { | |
tarballs.push(rustc_installer); | ||
tarballs.push(cargo_installer); | ||
tarballs.extend(rls_installer.clone()); | ||
tarballs.extend(clippy_installer.clone()); | ||
tarballs.push(clippy_installer); | ||
tarballs.extend(miri_installer.clone()); | ||
tarballs.extend(rustfmt_installer.clone()); | ||
tarballs.extend(llvm_tools_installer); | ||
|
@@ -1761,9 +1755,6 @@ impl Step for Extended { | |
if rls_installer.is_none() { | ||
contents = filter(&contents, "rls"); | ||
} | ||
if clippy_installer.is_none() { | ||
contents = filter(&contents, "clippy"); | ||
} | ||
if miri_installer.is_none() { | ||
contents = filter(&contents, "miri"); | ||
} | ||
|
@@ -1805,13 +1796,11 @@ impl Step for Extended { | |
prepare("rust-docs"); | ||
prepare("rust-std"); | ||
prepare("rust-analysis"); | ||
prepare("clippy"); | ||
|
||
if rls_installer.is_some() { | ||
prepare("rls"); | ||
} | ||
if clippy_installer.is_some() { | ||
prepare("clippy"); | ||
} | ||
if miri_installer.is_some() { | ||
prepare("miri"); | ||
} | ||
|
@@ -1863,12 +1852,10 @@ impl Step for Extended { | |
prepare("rust-analysis"); | ||
prepare("rust-docs"); | ||
prepare("rust-std"); | ||
prepare("clippy"); | ||
if rls_installer.is_some() { | ||
prepare("rls"); | ||
} | ||
if clippy_installer.is_some() { | ||
prepare("clippy"); | ||
} | ||
if miri_installer.is_some() { | ||
prepare("miri"); | ||
} | ||
|
@@ -1989,25 +1976,23 @@ impl Step for Extended { | |
.arg(etc.join("msi/remove-duplicates.xsl")), | ||
); | ||
} | ||
if clippy_installer.is_some() { | ||
builder.run( | ||
Command::new(&heat) | ||
.current_dir(&exe) | ||
.arg("dir") | ||
.arg("clippy") | ||
.args(&heat_flags) | ||
.arg("-cg") | ||
.arg("ClippyGroup") | ||
.arg("-dr") | ||
.arg("Clippy") | ||
.arg("-var") | ||
.arg("var.ClippyDir") | ||
.arg("-out") | ||
.arg(exe.join("ClippyGroup.wxs")) | ||
.arg("-t") | ||
.arg(etc.join("msi/remove-duplicates.xsl")), | ||
); | ||
} | ||
builder.run( | ||
Command::new(&heat) | ||
.current_dir(&exe) | ||
.arg("dir") | ||
.arg("clippy") | ||
.args(&heat_flags) | ||
.arg("-cg") | ||
.arg("ClippyGroup") | ||
.arg("-dr") | ||
.arg("Clippy") | ||
.arg("-var") | ||
.arg("var.ClippyDir") | ||
.arg("-out") | ||
.arg(exe.join("ClippyGroup.wxs")) | ||
.arg("-t") | ||
.arg(etc.join("msi/remove-duplicates.xsl")), | ||
); | ||
if miri_installer.is_some() { | ||
builder.run( | ||
Command::new(&heat) | ||
|
@@ -2073,6 +2058,7 @@ impl Step for Extended { | |
.arg("-dCargoDir=cargo") | ||
.arg("-dStdDir=rust-std") | ||
.arg("-dAnalysisDir=rust-analysis") | ||
.arg("-dClippyDir=clippy") | ||
.arg("-arch") | ||
.arg(&arch) | ||
.arg("-out") | ||
|
@@ -2083,9 +2069,6 @@ impl Step for Extended { | |
if rls_installer.is_some() { | ||
cmd.arg("-dRlsDir=rls"); | ||
} | ||
if clippy_installer.is_some() { | ||
cmd.arg("-dClippyDir=clippy"); | ||
} | ||
if miri_installer.is_some() { | ||
cmd.arg("-dMiriDir=miri"); | ||
} | ||
|
@@ -2101,12 +2084,10 @@ impl Step for Extended { | |
candle("DocsGroup.wxs".as_ref()); | ||
candle("CargoGroup.wxs".as_ref()); | ||
candle("StdGroup.wxs".as_ref()); | ||
candle("ClippyGroup.wxs".as_ref()); | ||
if rls_installer.is_some() { | ||
candle("RlsGroup.wxs".as_ref()); | ||
} | ||
if clippy_installer.is_some() { | ||
candle("ClippyGroup.wxs".as_ref()); | ||
} | ||
if miri_installer.is_some() { | ||
candle("MiriGroup.wxs".as_ref()); | ||
} | ||
|
@@ -2138,14 +2119,12 @@ impl Step for Extended { | |
.arg("CargoGroup.wixobj") | ||
.arg("StdGroup.wixobj") | ||
.arg("AnalysisGroup.wixobj") | ||
.arg("ClippyGroup.wixobj") | ||
.current_dir(&exe); | ||
|
||
if rls_installer.is_some() { | ||
cmd.arg("RlsGroup.wixobj"); | ||
} | ||
if clippy_installer.is_some() { | ||
cmd.arg("ClippyGroup.wixobj"); | ||
} | ||
if miri_installer.is_some() { | ||
cmd.arg("MiriGroup.wixobj"); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[alias] | ||
uitest = "test --test compile-test" | ||
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --" | ||
|
||
[build] | ||
rustflags = ["-Zunstable-options"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.yml] | ||
indent_size = 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto eol=lf | ||
*.rs text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4 | ||
*.fixed linguist-language=Rust |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- | ||
Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. | ||
|
||
For bug reports and false positives, please include the output of `cargo clippy -V` in the report. | ||
|
||
Thank you for using Clippy! | ||
|
||
Write your comment below this line: --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Thank you for making Clippy better! | ||
|
||
We're collecting our changelog from pull request descriptions. | ||
If your PR only updates to the latest nightly, you can leave the | ||
`changelog` entry as `none`. Otherwise, please write a short comment | ||
explaining your change. | ||
|
||
If your PR fixes an issue, you can add "fixes #issue_number" into this | ||
PR description. This way the issue will be automatically closed when | ||
your PR is merged. | ||
|
||
If you added a new lint, here's a checklist for things that will be | ||
checked during review or continuous integration. | ||
|
||
- [ ] Followed [lint naming conventions][lint_naming] | ||
- [ ] Added passing UI tests (including committed `.stderr` file) | ||
- [ ] `cargo test` passes locally | ||
- [ ] Executed `cargo dev update_lints` | ||
- [ ] Added lint documentation | ||
- [ ] Run `cargo dev fmt` | ||
|
||
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints | ||
|
||
Note that you can skip the above if you are just opening a WIP PR in | ||
order to get feedback. | ||
|
||
Delete this line and everything above before opening your PR. | ||
|
||
--- | ||
|
||
changelog: none |
Uh oh!
There was an error while loading. Please reload this page.