-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b45ef89
commit 9f1382e
Showing
13 changed files
with
204 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
*.sh | ||
!/script/*.sh | ||
*.test | ||
coverage.out | ||
/bin | ||
# intellij files | ||
.idea/ | ||
vendor/ | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
run: | ||
build-tags: | ||
- integration | ||
timeout: 10m | ||
linters: | ||
enable: | ||
- dogsled | ||
|
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,15 @@ | ||
#!/bin/sh | ||
#/ script/fmt.sh runs go fmt on all go files in the project. | ||
|
||
set -e | ||
|
||
CDPATH="" cd -- "$(dirname -- "$0")/.." | ||
|
||
MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" | ||
|
||
for dir in $MOD_DIRS; do | ||
( | ||
cd "$dir" | ||
go fmt ./... | ||
) | ||
done |
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,48 @@ | ||
#!/bin/sh | ||
#/ script/generate.sh runs go generate on all modules in this repo. | ||
#/ `script/generate.sh --check` checks that the generated files are up to date. | ||
|
||
set -e | ||
|
||
CDPATH="" cd -- "$(dirname -- "$0")/.." | ||
|
||
if [ "$1" = "--check" ]; then | ||
GENTEMP="$(mktemp -d)" | ||
git worktree add -q --detach "$GENTEMP" | ||
trap 'git worktree remove -f "$GENTEMP"; rm -rf "$GENTEMP"' EXIT | ||
for f in $(git ls-files -com --exclude-standard); do | ||
target="$GENTEMP/$f" | ||
mkdir -p "$(dirname -- "$target")" | ||
cp "$f" "$target" | ||
done | ||
if [ -f "$(pwd)"/bin ]; then | ||
ln -s "$(pwd)"/bin "$GENTEMP"/bin | ||
fi | ||
( | ||
cd "$GENTEMP" | ||
git add . | ||
git -c user.name='bot' -c user.email='bot@localhost' commit -m "generate" -q --allow-empty | ||
script/generate.sh | ||
[ -z "$(git status --porcelain)" ] || { | ||
msg="Generated files are out of date. Please run script/generate.sh and commit the results" | ||
if [ -n "$GITHUB_ACTIONS" ]; then | ||
echo "::error ::$msg" | ||
else | ||
echo "$msg" 1>&2 | ||
fi | ||
git diff | ||
exit 1 | ||
} | ||
) | ||
exit 0 | ||
fi | ||
|
||
MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" | ||
|
||
for dir in $MOD_DIRS; do | ||
( | ||
cd "$dir" | ||
go generate ./... | ||
go mod tidy -compat '1.17' | ||
) | ||
done |
Oops, something went wrong.