chore(pre_commit): remove exclusion for trailing-whitespace hook#2049
chore(pre_commit): remove exclusion for trailing-whitespace hook#2049
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request removes the exclusion of test files from the trailing-whitespace pre-commit hook and updates test fixtures to comply with the stricter formatting requirements.
Key Changes:
- Removed the
exclude: test/.*\.pyrule from thetrailing-whitespacehook in pre-commit configuration, making trailing whitespace checks apply to all Python files including tests - Refactored
FILE_2_CONTENTtest fixture to eliminate trailing whitespace while maintaining semantic equivalence by converting the multiline string format to use an escaped newline character - Removed the
# noqacomment that was previously suppressing the trailing whitespace linting warning
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.pre-commit-config.yaml |
Removed test directory exclusion from trailing-whitespace hook to apply consistent formatting checks across all Python files |
test/utils/test_file.py |
Refactored FILE_2_CONTENT string literal to eliminate trailing whitespace by using escaped newline notation, and removed the now-unnecessary noqa comment |
The changes in this PR are correct and achieve the stated goal. The string refactoring in test/utils/test_file.py maintains semantic equivalence (the resulting string value is identical), while eliminating the trailing whitespace that previously required a linting suppression comment. The pre-commit configuration change makes formatting checks more consistent across the codebase by removing the special exception for test files.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request includes minor updates to the
.pre-commit-config.yamland a test utility file. The main focus is on improving consistency and formatting in test content and pre-commit hook configuration.Formatting and configuration improvements:
FILE_2_CONTENTstring intest/utils/test_file.pyto have consistent newline and whitespace formatting.exclude: test/.*\.pyrule from thetrailing-whitespacehook in.pre-commit-config.yaml, so test files will now be checked for trailing whitespace.