Skip to content
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

./x.py: add --only lint1,lint2 flag to ./x.py clippy which only runs specified lints and ignores all others #78821

Closed
wants to merge 1 commit into from

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
Collaborator

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.

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