Skip to content

feat: check linters match pre-commit config in lint-shared - #79

Merged
ineedjet merged 4 commits into
mainfrom
feat/check-precommit-sync-in-lint-shared
Jun 24, 2026
Merged

feat: check linters match pre-commit config in lint-shared#79
ineedjet merged 4 commits into
mainfrom
feat/check-precommit-sync-in-lint-shared

Conversation

@ineedjet

Copy link
Copy Markdown
Contributor

Summary

Adds a sync-check step to lint-shared.yml that runs before linting.

If the calling repo has a .pre-commit-config.yaml with a rubykatzen/baseline entry, the step compares its hook ids against the linters workflow input. Fails if they differ.

  • Skipped entirely when .pre-commit-config.yaml is absent (hashFiles guard)
  • Skipped when no rubykatzen/baseline repo section is found (no error, just a notice)
  • Uses inputs.linters directly via env var — no workflow file parsing needed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@ineedjet

ineedjet commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

линтовать надо до патч версии, хардкодить проверку наличия pre-commit-config или добавить во входной список?

ineedjet and others added 3 commits June 24, 2026 23:57
- Add .github/actions/check-precommit-sync/action.yml — composite action
  matching the existing lint-* pattern (calls hooks/ script via bash)
- Add hooks/check-precommit-sync.py — Python script that compares
  baseline hook ids against workflow linters input
- Replace inline heredoc in lint-shared.yml with a uses: reference gated
  on contains(inputs.linters, 'pre-commit') for explicit opt-in
- Add pre-commit to supported linters in inputs description
- Fix whitespace bug: strip() each token before set comparison
- Exclude the pre-commit sentinel itself from the set comparison
- Use ::notice:: / ::error:: annotations for GH Actions log integration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Graceful skip made no sense with explicit opt-in: if pre-commit is in
linters, all three conditions must hold — file exists, baseline repo
entry exists, hook ids match. Any gap is now a hard failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ineedjet
ineedjet enabled auto-merge (squash) June 24, 2026 22:01
@ineedjet
ineedjet merged commit 3f4dcd8 into main Jun 24, 2026
1 check failed
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