Skip to content

Add no-defaults linting - #3124

Merged
adamtheturtle merged 3 commits into
mainfrom
agent/add-no-defaults-linter
Aug 6, 2026
Merged

Add no-defaults linting#3124
adamtheturtle merged 3 commits into
mainfrom
agent/add-no-defaults-linter

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Aug 5, 2026

Copy link
Copy Markdown
Member

Add no-defaults v1.0.0 to the pre-commit/prek configuration.

The policy rejects defaults everywhere in tests/** and for private functions, classes, and modules elsewhere. Existing defaults are behavior-preservingly baselined with targeted # noqa: NOD001 comments where necessary; Ruff is configured to recognize the external NOD rule family. Vendored Typeshed is excluded where applicable.

Validated with prek validate-config, prek run no-defaults --all-files, and Ruff checks.


Note

Low Risk
Tooling and lint configuration only; no runtime or API behavior changes.

Overview
Adds no-defaults (v1.0.1) to dev dependencies and wires it into pre-commit as a serial Python hook (uv run --extra=dev no-defaults), alongside existing strict-kwargs-style checks.

Configures policy in [tool.no_defaults]: private_only = true for production code (private functions/classes/modules) and per_file_enforcement."tests/**" = "all" so tests disallow defaults everywhere. Ruff is updated with lint.external = ["NOD"] so # noqa: NOD001 suppressions are recognized when the linter runs.

Reviewed by Cursor Bugbot for commit 4c3d1eb. Bugbot is set up for automated code reviews on this repo. Configure here.

@adamtheturtle
adamtheturtle marked this pull request as ready for review August 5, 2026 18:30
adamtheturtle and others added 3 commits August 6, 2026 06:46
Picks up the fix for annotated locals in dataclass methods being
misreported as fields (adamtheturtle/no-defaults#6).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Run no-defaults as a local uv hook instead of the upstream pre-commit
hook, matching the other locally-defined hooks. The pin moves to the dev
extra in pyproject.toml, and the hook joins the pre-commit.ci skip list
alongside the other hooks that need project dependencies.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@adamtheturtle
adamtheturtle force-pushed the agent/add-no-defaults-linter branch from 0c64e8f to 4c3d1eb Compare August 6, 2026 05:56
@adamtheturtle
adamtheturtle merged commit 7ed28d4 into main Aug 6, 2026
15 checks passed
@adamtheturtle
adamtheturtle deleted the agent/add-no-defaults-linter branch August 6, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant