Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit a890a52

Browse files
committed
fixup! fixup! Add gendocs ci step
1 parent 45b59d0 commit a890a52

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

ci/steps/fmt.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#!/bin/bash
2+
3+
set -euo pipefail
4+
25
echo "Formatting..."
36

47
go mod tidy
58
gofmt -w -s .
69
goimports -w "-local=$$(go list -m)" .
710

8-
if [ "$CI" != "" ]; then
9-
if [[ $(git ls-files --other --modified --exclude-standard) != "" ]]; then
11+
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
1012
echo "Files need generation or are formatted incorrectly:"
1113
git -c color.ui=always status | grep --color=no '\e\[31m'
1214
echo "Please run the following locally:"
1315
echo " ./ci/steps/fmt.sh"
1416
exit 1
1517
fi
16-
fi

ci/steps/gendocs.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
3+
set -euo pipefail
4+
25
echo "Generating docs..."
36

47
cd "$(dirname "$0")"
@@ -13,12 +16,10 @@ for filename in ./docs/*.md; do
1316
done
1417

1518

16-
if [ "$CI" != "" ]; then
17-
if [[ $(git ls-files --other --modified --exclude-standard) != "" ]]; then
18-
echo "Documentation needs generation:"
19-
git -c color.ui=always status | grep --color=no '\e\[31m'
20-
echo "Please run the following locally:"
21-
echo " ./ci/steps/gendocs.sh"
22-
exit 1
23-
fi
24-
fi
19+
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
20+
echo "Documentation needs generation:"
21+
git -c color.ui=always status | grep --color=no '\e\[31m'
22+
echo "Please run the following locally:"
23+
echo " ./ci/steps/gendocs.sh"
24+
exit 1
25+
fi

ci/steps/lint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3+
set -euo pipefail
4+
35
echo "Linting..."
46

57
go vet ./...
6-
golint -set_exit_status ./...
8+
golint -set_exit_status ./...

0 commit comments

Comments
 (0)