chore: add pre-check script to validate lint, gen, test, and build#6293
Open
sachin9058 wants to merge 3 commits intomindersec:mainfrom
Open
chore: add pre-check script to validate lint, gen, test, and build#6293sachin9058 wants to merge 3 commits intomindersec:mainfrom
sachin9058 wants to merge 3 commits intomindersec:mainfrom
Conversation
Comment on lines
+7
to
+8
| echo "Running go mod tidy..." | ||
| go mod tidy |
Member
There was a problem hiding this comment.
Why not roll this into the make gen target?
Comment on lines
+16
to
+17
| echo "Running tests..." | ||
| go test ./... |
Member
There was a problem hiding this comment.
We have a make test target which will run this.
Comment on lines
+13
to
+14
| echo "Running linter..." | ||
| golangci-lint run |
Member
There was a problem hiding this comment.
make lint will run this and buf lint.
Comment on lines
+19
to
+20
| echo "Building project..." | ||
| go build ./... |
Member
There was a problem hiding this comment.
make build will run all the binary builds
Comment on lines
+48
to
+49
| check: | ||
| ./scripts/precheck.sh |
Member
There was a problem hiding this comment.
Except for help, we have all the remaining targets in .mk/*.mk. What do you think of moving the check target to develop.mk and having it depend on the gen, lint, test, and build targets?
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
This PR introduces a unified pre-check script to help contributors validate changes locally before pushing.
Currently, contributors need to manually run multiple commands such as
go mod tidy,make gen, linting, tests, and build. Missing any of these steps (e.g., forgetting to commit generated files) can lead to avoidable CI failures.This change adds:
scripts/precheck.sh) that runs all required checksmake check) for convenienceThis improves contributor experience and reduces CI failures.
No new dependencies are introduced.
Fixes #6292
Testing
The changes were tested locally by running:
make check
This executes:
All steps completed successfully with no lint issues, test failures, or build errors.