Skip to content

Add strict-kwargs pre-commit hook in fix mode#3004

Merged
adamtheturtle merged 9 commits into
mainfrom
chore/strict-kwargs-pre-commit
May 18, 2026
Merged

Add strict-kwargs pre-commit hook in fix mode#3004
adamtheturtle merged 9 commits into
mainfrom
chore/strict-kwargs-pre-commit

Conversation

@adamtheturtle
Copy link
Copy Markdown
Member

@adamtheturtle adamtheturtle commented May 18, 2026

Summary

  • Add the strict-kwargs pre-commit hook (rev: 2026.5.18) with args: [fix] so positional call arguments are rewritten to keyword form on commit.
  • Skip the hook in pre-commit CI (builds from source and needs a Rust toolchain).
  • Mirror [tool.mypy_strict_kwargs] into [tool.strict_kwargs] where custom ignore lists already exist.

Test plan

  • pre-commit run strict-kwargs --all-files

Note

Low Risk
Low risk: adds a new local pre-commit auto-fixer and a dev dependency, without changing runtime/library code paths.

Overview
Adds a new pre-commit hook, strict-kwargs-fix, that runs strict-kwargs fix on Python files (serialized via require_serial) to automatically rewrite positional call arguments into keyword form.

Updates pre-commit CI to skip this hook, and pins strict-kwargs==2026.5.18.post1 in pyproject.toml under dev dependencies so the hook can be executed via uv run.

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

Comment thread .pre-commit-config.yaml Outdated
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from 17bd710 to d899649 Compare May 18, 2026 11:12
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from d899649 to aeb3609 Compare May 18, 2026 11:19
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from aeb3609 to 75578bb Compare May 18, 2026 12:08
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from 75578bb to f82dbe0 Compare May 18, 2026 12:27
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from 9245fcc to db1978c Compare May 18, 2026 12:56
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from db1978c to 95cc17f Compare May 18, 2026 13:05
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from 9cb5192 to fcd8ff5 Compare May 18, 2026 13:08
@adamtheturtle adamtheturtle force-pushed the chore/strict-kwargs-pre-commit branch from 8c2753e to 7f27d1b Compare May 18, 2026 13:13
Comment thread .pre-commit-config.yaml
additional_dependencies:
- *uv_version
stages: [pre-commit]
require_serial: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixer hook placed after formatter causes extra passes

Medium Severity

The strict-kwargs-fix hook is positioned after ruff-format-fix in the hook execution order. Since strict-kwargs fix rewrites positional arguments to keyword form (e.g., adding name= prefixes), it lengthens lines. The formatter that would wrap these lines has already run, so the output may violate line-length rules, requiring an additional pre-commit pass to converge. The established pattern in this config places code-modifying fixers (pydocstringformatter, ruff-check-fix) before the formatter (ruff-format-fix).

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7f27d1b. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 96d519c. Configure here.

Comment thread pyproject.toml Outdated
@adamtheturtle adamtheturtle merged commit 986e5af into main May 18, 2026
15 checks passed
@adamtheturtle adamtheturtle deleted the chore/strict-kwargs-pre-commit branch May 18, 2026 15:09
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