rust-lang / rust-lang/rust-clippy
More complex complexity check(s)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
Hi, sorry if I missed something. Just a thoughts, I hope they can be useful, feel free to close if not.
I am not yet in Rust (but I hope to be at some point), but already wondering about linting.
There are many different aspects of linting like style, best practices and typical mistakes, but IMO main thing is fighting with complexity, so I would like to have two set of checks:
- Complexity checks for all levels from line to package, I looked briefly to existing complexity rules plus cognitive complexity from other category - a lot of checks, but I was not able to find anything about file/package size. I really like this article which explains the idea of measuring complexity on all levels, they created wemake-python-styleguide plugin for flake8.
- Modularization/layering - especially important in case of monorepo, but can be useful in any case. Python has import-linter and tach (tach is written is Rust as many other cool tools for Python). The idea - linter will warn you (pre-commit check will fail) if you are trying to introduce dependency which violates layers/modules borders. Perhaps something can be implemented on top of cargo-deny, but not sure.
Advantage
No response
Drawbacks
No response
Example
<code>
Could be written as:
<code>
Comparison with existing lints
No response
Additional Context
No response
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, entry point, or test is named. Start by reviewing Clippy’s existing complexity rules and the proposed cargo-deny direction, then narrow the request to one concrete check with examples and a defined scope. Done would require an agreed implementation target rather than the current broad proposal.
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