rust-lang / rust-lang/rust-clippy

More complex complexity check(s)

Open
#16,274 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint
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:

  1. 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.
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.