-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Problem
When a relatively medium/large project migrates to clippy, there might be a large number of lint diagnostics. It can be difficult to get a clear picture of the category with the most problems.
@dclong raised an issue here describing this feature request in the clippy github repo.
Proposed Solution
It would help if running cargo clippy
automatically shows counts of lints whenever a large number of diagnostics (> 10) are generated. For example, cargo clippy should show something like
`my_project` (bin "my_project") generated 28 warnings
Summary of diagnostics:
clippy::collapsible_if: 16
clippy::collapsible_else_if: 4
clippy::approx_constant: 3
dead_code: 3
clippy::single_match: 1
clippy::new_without_default: 1
Although the default behavior is to show this summary whenever the total amount of diagnostics is greater than 10, we should also allow users to override whether the summary is shown by running cargo clippy --summary
or cargo clippy --no-summary
.
Notes
Note that the summary includes both warnings generated from clippy and rustc.