Add pre-commit lint hooks: cast, private functions, partial assertions#2555
Merged
hiroshinishio merged 1 commit intomainfrom Apr 19, 2026
Merged
Add pre-commit lint hooks: cast, private functions, partial assertions#2555hiroshinishio merged 1 commit intomainfrom
hiroshinishio merged 1 commit intomainfrom
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
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.
Summary
check_cast_usage.sh: Blockscast()in implementation files (allowed in test fixtures)check_private_functions.sh: Blocks_-prefixed function definitions in impl files (inline or own file)check_partial_assertions.sh: Blocksassert X in Yin test files (useassert X == Y)check_test_files.shto skip comment-only diffs (no test change required for adding/removing comments)-m "not integration"to cut 236s from pre-commitSocial Media Post (GitAuto)
Add pre-commit hooks enforcing code quality rules
Social Media Post (Wes)
Three rules I kept repeating in code reviews: no cast in production code, no private functions, no partial assertions. Wrote shell scripts to enforce all three at commit time. Now I review logic instead of style.