rust-lang / rust-lang/rust-clippy
Migrating a project which hasn't used clippy before
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
We don't have a nice strategy for migration yet. Basically one can only fix all lints one by one until no more are reported. If this process takes a while and is done in steps, new lints might trigger and existing lints might trigger on new code.
My view (based on existing tools, plans for tools and practices I've seen with the introduction of static analysis tools in existing projects):
- use rustfix in automatic mode
- needs suggestions vs guesses for being effective
- requires elimination of snippet defaulting (often "..")
- statistical linting
- collect number of occurrences for every lint in a file
- CI blocks on non-increasing numbers
- every now and then do a PR which only reduces the occurrences but doesn't change behaviour
- a way to disable macro checks.
- Some safety critical code needs to be reviewed in its entirety.
- Companies writing safety critical software revealed that:
- Style guides are part of the safety rules, because readability is really important when you need to get your software certified
- Project specific static analyses are a must. Right now this means that the static analyses authors are in an external company and need to sign NDAs
- some use ui-test frameworks that erase line numbers instead of purely collecting statistics
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by reviewing the proposed rustfix, statistical linting and CI, macro-check, and ui-test directions; done would require an agreed, concrete migration strategy with a defined scope and validation approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100