forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (flyteorg#303)
* Added ci check for go generate Signed-off-by: Yuvraj <[email protected]> Signed-off-by: Katrina Rogan <[email protected]> Co-authored-by: Katrina Rogan <[email protected]>
- Loading branch information
Showing
6 changed files
with
87 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,5 +69,3 @@ seed_projects: | |
|
||
all: compile | ||
|
||
generate: download_tooling | ||
@go generate ./... |
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 "Generating pflags" | ||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.