Skip to content

Enforce unique hook names and keyword-only validators - #3404

Open
nyxst4ck wants to merge 1 commit into
VWS-Python:mainfrom
nyxst4ck:fix/3401-custom-linter-conventions
Open

Enforce unique hook names and keyword-only validators#3404
nyxst4ck wants to merge 1 commit into
VWS-Python:mainfrom
nyxst4ck:fix/3401-custom-linter-conventions

Conversation

@nyxst4ck

@nyxst4ck nyxst4ck commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • report the yamlfix pre-commit hook with its own name instead of pyproject-fmt
  • make the two remaining query validators keyword-only, matching the rest of the validator/runner APIs
  • add custom linter regressions so duplicate hook IDs/names and positional validate_*/run_* parameters cannot recur

Reproduction

Before the fix, the focused custom-linter tests fail with:

  • Pre-commit hook names must be unique because pyproject-fmt is used twice
  • Functions must be keyword-only listing validate_accept_header and validate_auth_header_has_signature

Both existing call sites already pass request_headers by keyword, so the signature correction does not require call-site changes.

Tests

  • uv run pytest ci/test_custom_linters.py -q -k 'pre_commit_hook_identifiers_unique or validate_and_run_functions_are_keyword_only' ? 2 passed
  • uv run ruff check ci/test_custom_linters.py src/mock_vws/_query_validators/accept_header_validators.py src/mock_vws/_query_validators/auth_validators.py ? passed
  • uv run ruff format --check ci/test_custom_linters.py src/mock_vws/_query_validators/accept_header_validators.py src/mock_vws/_query_validators/auth_validators.py ? passed

Fixes #3401

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.

Two conventions are broken in single spots with nothing checking them

1 participant