Skip to content

Conversation

@matthiaskrgr
Copy link
Member

for example:
./x.py clippy --only or_fun_call,type_complexity
will only run these two clippy lints.

…specified lints and ignores all others

for example:
 ./x.py clippy --only or_fun_call,type_complexity
will only run these two clippy lints
@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 6, 2020
@Mark-Simulacrum
Copy link
Member

Hm, I guess this doesn't seem bad but feels like rustbuild is really the wrong place for it... I am wondering what you think about trying to propose this for clippy, at which point something like CLIPPYFLAGS="--only foo" x.py clippy would work. Presumably it's a more widespread need than just the rustc codebase?

If that feels wrong though this approach seems fine, not too complicated.

@matthiaskrgr
Copy link
Member Author

In the clippy readme, we have already documented that one can run cargo clippy -- -Aclippy::all -Wclippy::only_this_one for a single project, but for x.py, simply putting this into RUSTFLAGS does not work unfortunately which is why I added the workaround

 error[E0602]: unknown lint: `clippy::all`
  |
  = note: requested on the command line with `-A clippy::all`

@Mark-Simulacrum
Copy link
Member

Hm, I would like to fix this by fixing that - I'm not sure why it's not working, but seems plausible that it's because there's a non-clippy cargo running to build bootstrap itself. Could we do this with a general clippy args variable (or just x.py clippy -- <args here>)

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2020
@Mark-Simulacrum
Copy link
Member

@matthiaskrgr I think I recently saw a comment to the effect of you having done this somewhere else, but maybe that was in this PR?

I am leaning towards closing this PR unless it switches to the "general arguments" shape i.e., x.py clippy -- --any-args-here.

@matthiaskrgr matthiaskrgr deleted the clippy_only branch January 25, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants