-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
rust-lang/cargo
#6759Labels
C-tracking-issueCategory: Tracking IssueCategory: Tracking IssueT-cargoType: cargo relatedType: cargo related
Description
See rust-lang/cargo#6664 (comment) for some context.
Currently cargo clippy
is a thin wrapper script around Cargo that invokes cargo check
with a RUSTC_WRAPPER: https://github.com/rust-lang/rust-clippy/blob/8dfabdf11c6cdaffd7c6e6552a6ead8d52c49b10/src/main.rs
It does some additional hacks to support the clippy dogfood test and passing down arguments.
We should move this into cargo proper, like rustc: Ideally it's just a copy of cargo check
that sets a different rustc executable (temporarily can be done by overriding RUSTC_WRAPPER, but the better solution probably involves modifying config.rustc()
https://github.com/rust-lang/cargo/blob/716b02cb4c7b75ce435eb06defa25bc2d725909c/src/cargo/util/config.rs#L194-L215
Steps:
- Add cargo clippy-preview to cargo Cargo clippy cargo#6759Make it work with dogfood tests Update dogfood tests to use cargo clippy-preview #4050Improve cargo integration, especially with cargo fix call clippy-driver directly rather than as a rustc_wrapper cargo#7006add better help Better help support in
clippy-driver
#4173Make cargo-clippy shell out to clippy-preview?Perhaps make-Wlintname
work as a shortcut for-Wclippy::lintname
rename and stabilize cargo clippy-previewTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
elichai, phansch, andrewbanchich, yaahc, sachaarbonel and 5 more
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: Tracking IssueCategory: Tracking IssueT-cargoType: cargo relatedType: cargo related
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Manishearth commentedon Mar 3, 2019
I think as a first step we should write a very basic
cargo clippy-preview
(nightly only?) subcommand for cargo that just is a copy of cargo check with rustc_wrapper set. We can also clean it up to make this part of the config.We can then do the back and forth of testing it with clippy to ensure it works, and eventually rename and ship it. We should probably continue to ship
cargo-clippy
for a couple releases since in some cases you use a cargo from an older release.Once we have this there are a bunch of nice changes we can make: e.g. we can modify the argument parsing so that you can just do
cargo clippy -Wclippy::foo
instead of needing the pesky--
.This also helps integration with cargo fix, since that can now be wholly solved on the cargo side.
Manishearth commentedon Mar 3, 2019
One implementation issue is that rustup currently does not export a clippy-driver binary, we should change it to do this.
Manishearth commentedon Mar 3, 2019
This could also be handled by using the current exe path I guess.
Manishearth commentedon Mar 3, 2019
Filed rust-lang/rustup#1678
I do have concerns as to how this will work for non-rustup users.
Manishearth commentedon Mar 15, 2019
@yaahallo is looking into implementing this
Auto merge of #6759 - yaahallo:cargo-clippy, r=alexcrichton
Manishearth commentedon May 1, 2019
Shouldn't have been closed
cargo clippy -- -Wall
gives a bogus file not found error #414748 remaining items