-
Couldn't load subscription status.
- Fork 0
feat(githooks): Implement robust, conditional pre-commit hooks #88
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
Open
dustinblack
wants to merge
2
commits into
main
Choose a base branch
from
ci/shared-pre-commit-and-prompts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…Adds scripts/msrv-check.sh\n- Invokes MSRV check from pre-commit hook\n\nAI-assisted-by: GPT-5
This commit significantly enhances the pre-commit hook to improve developer workflow, catch errors earlier, and ensure consistency with the CI pipeline. The script now includes conditional execution for both Rust and Python checks, ensuring that linters and formatters only run on relevant staged files. This optimization speeds up the commit process when changes are isolated to specific languages or documentation. Key changes: - Adds `cargo audit` to check for security vulnerabilities in Rust dependencies before every commit. - Aligns `cargo fmt` and `cargo test` commands with the CI configuration by adding the `--all` and `--all-features` flags, respectively. - Introduces Python pre-commit checks that trigger when `.py` files are staged. These checks automatically format code using `black` and `isort`, and lint with `flake8`. - Activates the Python virtual environment at `utils/dashboard/.venv` when available. - Updates the README with instructions on how to enable the new repo-managed pre-commit hooks. - Adds a new `AGENTS.md` file to provide guidance and context for AI agents working on this project. - Adds a new `install-git-hooks.sh` script to simplify the setup of the pre-commit hooks. Ai-assisted-by: GPT-5, Gemini 2.5 Pro
📈 Changed lines coverage: N/A (0/0)✅ All new and modified lines are covered by tests!📊 Code Coverage Summary
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request introduces a comprehensive, repository-managed pre-commit framework to enhance the developer workflow, improve code quality, and ensure consistency between local development environments and the CI pipeline.
By enabling these hooks, developers will benefit from automated checks that catch formatting issues, linting errors, and potential security vulnerabilities before code is even committed. This helps reduce CI failures and streamlines the development process.
Key Changes
simplifies the one-time setup.
process fast and efficient.
easily discover and ingest these development guidelines, helping their contributions align with project standards.
How to Test
(Or run
bash scripts/install-git-hooks.sh)Test Rust changes:
Test Python changes:
Test no-op changes:
Type of Change
Testing
Checklist