-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script for checking diff of generated code (#229)
* Added script for checking diff of generated code Signed-off-by: Yuvraj <[email protected]>
- Loading branch information
Showing
8 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
echo "Running go generate" | ||
go generate ./... | ||
|
||
# This section is used by GitHub workflow to ensure that the generation step was run | ||
if [ -n "$DELTA_CHECK" ]; then | ||
DIRTY=$(git status --porcelain) | ||
if [ -n "$DIRTY" ]; then | ||
echo "FAILED: Go code updated without commiting generated code." | ||
echo "Ensure make generate has run and all changes are committed." | ||
DIFF=$(git diff) | ||
echo "diff detected: $DIFF" | ||
DIFF=$(git diff --name-only) | ||
echo "files different: $DIFF" | ||
exit 1 | ||
else | ||
echo "SUCCESS: Generated code is up to date." | ||
fi | ||
fi |
This file contains 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