Skip to content

Conversation

@dhellmann
Copy link
Member

Summary

  • Add EditorConfig + super-linter to enforce single trailing newlines on all files
  • Add pre-commit hooks with file formatting, linting, and type checking
  • Auto-fix newlines/whitespace in existing files

Developer Commands

hatch run lint:install-hooks  # Setup (run once)
hatch run lint:precommit      # Manual pre-commit run

Pre-commit now automatically runs on every commit with comprehensive file formatting, linting, and type checking.

🤖 Generated with https://claude.ai/code

@dhellmann
Copy link
Member Author

I will rebase this when #885 merges and apply any additional fixes.

@mergify mergify bot added the ci label Dec 16, 2025
dhellmann and others added 2 commits December 16, 2025 11:06
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>
@dhellmann dhellmann marked this pull request as ready for review December 16, 2025 16:31
@dhellmann dhellmann requested a review from a team as a code owner December 16, 2025 16:31
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
Copy link
Member

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

Copy link
Member Author

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.

dhellmann and others added 3 commits December 17, 2025 14:44
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>
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Copy link
Member

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?

Copy link
Member Author

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.

@mergify mergify bot merged commit 9bfe61f into python-wheel-build:main Dec 17, 2025
118 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants