Skip to content

Commit 2d0c651

Browse files
authored
Unrolled build for rust-lang#119486
Rollup merge of rust-lang#119486 - onur-ozkan:clippy-allow-dirty-and-staged, r=Mark-Simulacrum pass allow-{dirty,staged} to clippy Support of Clippy's `--allow-dirty` and `--allow-staged` flags on bootstrap. Resolves rust-lang#119483
2 parents 9212108 + 96bd9cd commit 2d0c651

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

src/bootstrap/src/core/build_steps/check.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn args(builder: &Builder<'_>) -> Vec<String> {
2828
arr.iter().copied().map(String::from)
2929
}
3030

31-
if let Subcommand::Clippy { fix, allow, deny, warn, forbid, .. } = &builder.config.cmd {
31+
if let Subcommand::Clippy { fix, allow_dirty, allow_staged, allow, deny, warn, forbid } =
32+
&builder.config.cmd
33+
{
3234
// disable the most spammy clippy lints
3335
let ignored_lints = vec![
3436
"many_single_char_names", // there are a lot in stdarch
@@ -49,7 +51,16 @@ fn args(builder: &Builder<'_>) -> Vec<String> {
4951
// As a workaround, avoid checking tests and benches when passed --fix.
5052
"--lib", "--bins", "--examples",
5153
]));
54+
55+
if *allow_dirty {
56+
args.push("--allow-dirty".to_owned());
57+
}
58+
59+
if *allow_staged {
60+
args.push("--allow-staged".to_owned());
61+
}
5262
}
63+
5364
args.extend(strings(&["--", "--cap-lints", "warn"]));
5465
args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint)));
5566
let mut clippy_lint_levels: Vec<String> = Vec::new();

src/bootstrap/src/core/config/flags.rs

+4
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ pub enum Subcommand {
255255
Clippy {
256256
#[arg(long)]
257257
fix: bool,
258+
#[arg(long, requires = "fix")]
259+
allow_dirty: bool,
260+
#[arg(long, requires = "fix")]
261+
allow_staged: bool,
258262
/// clippy lints to allow
259263
#[arg(global(true), short = 'A', action = clap::ArgAction::Append, value_name = "LINT")]
260264
allow: Vec<String>,

src/etc/completions/x.py.fish

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-profile-use -d
143143
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
144144
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l set -d 'override options in config.toml' -r -f
145145
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l fix
146+
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l allow-dirty
147+
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l allow-staged
146148
complete -c x.py -n "__fish_seen_subcommand_from clippy" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
147149
complete -c x.py -n "__fish_seen_subcommand_from clippy" -s i -l incremental -d 'use incremental compilation'
148150
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l include-default-paths -d 'include default paths in addition to the provided ones'

src/etc/completions/x.py.ps1

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
188188
[CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
189189
[CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
190190
[CompletionResult]::new('--fix', 'fix', [CompletionResultType]::ParameterName, 'fix')
191+
[CompletionResult]::new('--allow-dirty', 'allow-dirty', [CompletionResultType]::ParameterName, 'allow-dirty')
192+
[CompletionResult]::new('--allow-staged', 'allow-staged', [CompletionResultType]::ParameterName, 'allow-staged')
191193
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
192194
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
193195
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation')

src/etc/completions/x.py.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ _x.py() {
615615
return 0
616616
;;
617617
x.py__clippy)
618-
opts="-A -D -W -F -v -i -j -h --fix --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
618+
opts="-A -D -W -F -v -i -j -h --fix --allow-dirty --allow-staged --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
619619
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
620620
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
621621
return 0

src/etc/completions/x.py.zsh

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ _arguments "${_arguments_options[@]}" \
182182
'*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT: ' \
183183
'*--set=[override options in config.toml]:section.option=value:( )' \
184184
'--fix[]' \
185+
'--allow-dirty[]' \
186+
'--allow-staged[]' \
185187
'*-v[use verbose output (-vv for very verbose)]' \
186188
'*--verbose[use verbose output (-vv for very verbose)]' \
187189
'-i[use incremental compilation]' \

0 commit comments

Comments
 (0)