-
Notifications
You must be signed in to change notification settings - Fork 39
feat: enforce file newlines with super-linter and pre-commit hooks #889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I will rebase this when #885 merges and apply any additional fixes. |
Add EditorConfig configuration to ensure all files end with a single newline character and trim trailing whitespace. Enable VALIDATE_EDITORCONFIG in super-linter workflow to enforce these rules in CI. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add pre-commit configuration with hooks to: - Ensure all files end with single newline (end-of-file-fixer) - Remove trailing whitespace (trailing-whitespace) - Validate YAML and TOML syntax - Prevent merge conflict markers Integrate with existing hatch workflow and add CI job. Include setup instructions in CLAUDE.md. Applied automatic formatting fixes to existing files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
5f838d6 to
3a4952b
Compare
.github/workflows/check.yaml
Outdated
| run: python -m pip install hatch 'click!=8.3.0' | ||
|
|
||
| - name: Run pre-commit hooks | ||
| run: hatch run lint:install-hooks && hatch run lint:check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant run: hatch run lint:precommit instead of hatch run lint:check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, yes. I've fixed that.
Add local hooks to run hatch lint:check and mypy:check as part of pre-commit workflow, ensuring comprehensive code quality checks before commits. Add separate 'precommit' hatch script to manually run pre-commit hooks without circular dependency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove the old pre-commit script and rely instead on the pre-commit command to run the linters. Update the documentation to reflect the change in how the hook should be configured.
Add explicit utf-8 charset to fix super-linter EditorConfig validation error complaining about "Ascii" instead of "" encoding. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2b6d13b to
d7437f3
Compare
| @@ -0,0 +1,26 @@ | |||
| repos: | |||
| - repo: https://github.com/pre-commit/pre-commit-hooks | |||
| rev: v4.5.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recent version is v6.0 , I guess the bot will update it once we merge this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the agent wrote this so I expect it was just using an older version. Let's see what dependabot gives us.
Summary
Developer Commands
Pre-commit now automatically runs on every commit with comprehensive file formatting, linting, and type checking.
🤖 Generated with https://claude.ai/code