Fix pre-commit CI failures by skipping local hooks that require virtual environment - #9476
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #9476 +/- ##
=======================================
Coverage 59.69% 59.69%
=======================================
Files 50 50
Lines 10261 10261
Branches 1379 1379
=======================================
Hits 6125 6125
Misses 3777 3777
Partials 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bdraco
marked this pull request as ready for review
July 13, 2025 22:31
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a CI configuration block to skip hooks that fail in the containerized pre-commit CI environment and updates the autoupdate settings.
- Introduces a
ci:section in.pre-commit-config.yamlto skippylint,clang-tidy-hash, andyamllinthooks on CI. - Sets the autoupdate commit message and changes the schedule from monthly to weekly.
- Ensures other hooks continue running unchanged.
Comments suppressed due to low confidence (1)
.pre-commit-config.yaml:7
- The schedule is set to
weekly, but the PR description indicates you intendeddaily. If daily updates are desired, update this value todaily.
autoupdate_schedule: weekly
jesserockz
approved these changes
Jul 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
This PR fixes pre-commit CI failures by adding a
ci:configuration section to.pre-commit-config.yamlthat skips hooks which have compatibility issues with the pre-commit CI environment:.clang-formatand.clang-tidyfilesThe configuration also changes the autoupdate schedule from monthly to weekly to keep dependencies current.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml:# N/A - This is a CI configuration changeChecklist:
tests/folder).If user exposed functionality or configuration variables are added/changed:
Additional Notes
The error was occurring because pre-commit CI runs in a containerized environment without access to the local virtual environment that
script/run-in-env.pyexpects. By adding the.pre-commit-ci.yamlconfiguration file with theskipdirective, we ensure: