Summary
Clippy already denies the machine-checkable half of "low-effort code"
smells (unwrap/expect, panic!, todo!()/unimplemented!(),
dead_code, missing_docs, print/dbg! macros, etc., per this crate's
[lints] table and clippy.toml). What lint tooling structurally cannot
check is comment content and diff-local repetition -- two common
low-effort-code tells that show up regardless of whether the code was
written by hand or with AI assistance (this project's own
CONTRIBUTING.md/docs/conventions.md already hold both to the same bar:
"every contributor is responsible for the code they submit").
Concretely, today nothing in CI catches:
- Leftover
TODO/FIXME/XXX/HACK markers left in from a work-in-progress
commit.
- Commented-out code left behind after a refactor.
- Comments that just narrate what the next line does (
docs/conventions.md
already states "Comments answer 'why?', never 'what?'" as a convention,
but nothing enforces it).
- The same numeric/string literal repeated 3+ times in a diff instead of
being hoisted into a named constant (docs/conventions.md calls out magic
constants as something to avoid).
- New
#[allow(clippy::...)]/#[expect(clippy::...)] suppressions added
without an accompanying justification.
Proposing a small, diff-scoped Python script (scripts/extended-lint.py)
that scans only lines added/changed versus the diff base, so pre-existing
code is never relitigated, and wires into the existing lint CI job
alongside make lint/make doc.
Evidence
Cargo.toml [lints] / clippy.toml: covers the structural half already.
docs/conventions.md "Comments vs Tracing" and "Additional Coding
Conventions" sections: state the conventions this script would help
enforce, but nothing currently checks them mechanically.
.github/workflows/tests.yaml lint job: currently runs make lint
(clippy + fmt) and make doc; no diff-content check exists.
Risk
None from not doing this beyond the status quo: these are style/hygiene
gaps, not correctness bugs, and this is a pre-GA alpha project. This is a
quality-of-life proposal, not an urgent finding.
Suggested fix
Add scripts/extended-lint.py (BLOCK on TODO markers and commented-out
code; WARN on narrating comments, repeated literals, weak identifier names,
and new clippy suppressions), a make extended-lint target, and a step in
the CI lint job that fetches the PR's base branch and runs it. See the
implementation in the linked pull request.
Severity: Low (developer-experience / code-hygiene enhancement)
Summary
Clippy already denies the machine-checkable half of "low-effort code"
smells (
unwrap/expect,panic!,todo!()/unimplemented!(),dead_code,missing_docs,print/dbg!macros, etc., per this crate's[lints]table andclippy.toml). What lint tooling structurally cannotcheck is comment content and diff-local repetition -- two common
low-effort-code tells that show up regardless of whether the code was
written by hand or with AI assistance (this project's own
CONTRIBUTING.md/docs/conventions.mdalready hold both to the same bar:"every contributor is responsible for the code they submit").
Concretely, today nothing in CI catches:
TODO/FIXME/XXX/HACKmarkers left in from a work-in-progresscommit.
docs/conventions.mdalready states "Comments answer 'why?', never 'what?'" as a convention,
but nothing enforces it).
being hoisted into a named constant (
docs/conventions.mdcalls out magicconstants as something to avoid).
#[allow(clippy::...)]/#[expect(clippy::...)]suppressions addedwithout an accompanying justification.
Proposing a small, diff-scoped Python script (
scripts/extended-lint.py)that scans only lines added/changed versus the diff base, so pre-existing
code is never relitigated, and wires into the existing
lintCI jobalongside
make lint/make doc.Evidence
Cargo.toml[lints]/clippy.toml: covers the structural half already.docs/conventions.md"Comments vs Tracing" and "Additional CodingConventions" sections: state the conventions this script would help
enforce, but nothing currently checks them mechanically.
.github/workflows/tests.yamllintjob: currently runsmake lint(clippy + fmt) and
make doc; no diff-content check exists.Risk
None from not doing this beyond the status quo: these are style/hygiene
gaps, not correctness bugs, and this is a pre-GA alpha project. This is a
quality-of-life proposal, not an urgent finding.
Suggested fix
Add
scripts/extended-lint.py(BLOCK on TODO markers and commented-outcode; WARN on narrating comments, repeated literals, weak identifier names,
and new clippy suppressions), a
make extended-linttarget, and a step inthe CI
lintjob that fetches the PR's base branch and runs it. See theimplementation in the linked pull request.
Severity: Low (developer-experience / code-hygiene enhancement)