-
Notifications
You must be signed in to change notification settings - Fork 554
Added pre-commit hooks support (#1138) #1149
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
base: main
Are you sure you want to change the base?
Added pre-commit hooks support (#1138) #1149
Conversation
16be955 to
0425c3a
Compare
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.
Pull request overview
This PR introduces pre-commit hooks support to the repository by adding a .pre-commit-config.yaml configuration file. The configuration includes various linting and validation hooks, though most are currently commented out to allow for incremental adoption.
Key changes:
- Added
.pre-commit-config.yamlwith hook configurations for file checks, linting, formatting, and security scanning - Most hooks are commented out to minimize initial impact and allow gradual enablement
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,70 @@ | |||
| repos: | |||
Copilot
AI
Dec 29, 2025
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 indentation at the start of this file is incorrect. The "repos:" key should have no leading spaces. Currently, it has 2 leading spaces which will cause YAML parsing errors.
| repos: | ||
| # Syncs pre-commit dependencies with the latest versions. | ||
| - repo: https://github.com/mxr/sync-pre-commit-deps | ||
| rev: "v0.0.1" |
Copilot
AI
Dec 29, 2025
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 version for the sync-pre-commit-deps hook appears to be very old (v0.0.1). This is the initial release and may not be stable or feature-complete. Consider using a more recent stable version to ensure better reliability and functionality.
| rev: "v0.0.1" | |
| rev: "v0.0.5" |
| # - id: check-vcs-permalinks | ||
| # - id: check-yaml | ||
| # - id: destroyed-symlinks | ||
| # - id: detect-private-key |
Copilot
AI
Dec 29, 2025
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 commented-out detect-private-key hook should be enabled to prevent accidentally committing sensitive information like private keys to the repository. This is a critical security feature that should be active, especially in a project that will be shared or made public.
| # - id: detect-private-key | |
| - id: detect-private-key |
| # - id: end-of-file-fixer | ||
| # - id: fix-byte-order-marker | ||
| # - id: mixed-line-ending | ||
| # - id: pretty-format-json | ||
| # args: [--autofix, --no-sort-keys] | ||
| # - id: trailing-whitespace |
Copilot
AI
Dec 29, 2025
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 end-of-file-fixer and trailing-whitespace hooks should be enabled to maintain consistent formatting across the codebase. These are low-impact hooks that automatically fix common formatting issues and help maintain code quality standards without requiring significant modifications.
| # - id: end-of-file-fixer | |
| # - id: fix-byte-order-marker | |
| # - id: mixed-line-ending | |
| # - id: pretty-format-json | |
| # args: [--autofix, --no-sort-keys] | |
| # - id: trailing-whitespace | |
| - id: end-of-file-fixer | |
| # - id: fix-byte-order-marker | |
| # - id: mixed-line-ending | |
| # - id: pretty-format-json | |
| # args: [--autofix, --no-sort-keys] | |
| - id: trailing-whitespace |
Issue #1138
Changes Made
devcontainer.json:
Introduced the
.pre-commit-config.yamlfile containing hooks. Currently, the hooks are commented out, as enabling them will require significant modifications. It may be beneficial to enable them incrementally.Some work still remains to enhance robustness and usability.