Skip to content

Commit

Permalink
mv scripts script
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Sep 21, 2023
1 parent 93bbca3 commit 13c9ed3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
with:
go-version: 1.x
cache-dependency-path: "**/go.sum"
- run: scripts/lint.sh
- run: script/lint.sh
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
- name: Run go test
run: |
if [ -n "${{ matrix.update-coverage }}" ]; then
scripts/test.sh -race -covermode atomic -coverprofile coverage.txt ./...
script/test.sh -race -covermode atomic -coverprofile coverage.txt ./...
exit
fi
scripts/test.sh -race -covermode atomic ./...
script/test.sh -race -covermode atomic ./...
- name: Ensure integration tests build
# don't actually run tests since they hit live GitHub API
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.sh
!/scripts/*.sh
!/script/*.sh
*.test
coverage.out
/bin
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ are more sensitive, emailed to <[email protected]>.
either add tests to cover those lines or add a PR comment explaining the
untested lines.

4. Run `scripts/fmt.sh`, `scripts/test.sh` and `scripts/lint.sh` to format your code and
check that it passes all tests and linters. `scripts/lint.sh` may also tell you
that generated files need to be updated. If so, run `scripts/generate.sh` to
4. Run `script/fmt.sh`, `script/test.sh` and `script/lint.sh` to format your code and
check that it passes all tests and linters. `script/lint.sh` may also tell you
that generated files need to be updated. If so, run `script/generate.sh` to
update them.

5. Do your best to have [well-formed commit messages][] for each change. This
Expand All @@ -75,18 +75,18 @@ are more sensitive, emailed to <[email protected]>.

## Scripts ##

The `scripts` directory has shell scripts that help with common development
The `script` directory has shell scripts that help with common development
tasks.

**scripts/fmt.sh** formats all go code in the repository.
**script/fmt.sh** formats all go code in the repository.

**scripts/generate.sh** runs code generators and `go mod tidy` on all modules. With
**script/generate.sh** runs code generators and `go mod tidy` on all modules. With
`--check` it checks that the generated files are current.

**scripts/lint.sh** runs linters on the project and checks generated files are
**script/lint.sh** runs linters on the project and checks generated files are
current.

**scripts/test.sh** runs tests on all modules.
**script/test.sh** runs tests on all modules.

## Other notes on code organization ##

Expand Down
2 changes: 1 addition & 1 deletion scripts/fmt.sh → script/fmt.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
#/ scripts/fmt.sh runs go fmt on all go files in the project.
#/ script/fmt.sh runs go fmt on all go files in the project.

set -e

Expand Down
8 changes: 4 additions & 4 deletions scripts/generate.sh → script/generate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#/ scripts/generate.sh runs go generate on all modules in this repo.
#/ `scripts/generate.sh --check` checks that the generated files are up to date.
#/ 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

Expand All @@ -22,9 +22,9 @@ if [ "$1" = "--check" ]; then
cd "$GENTEMP"
git add .
git -c user.name='bot' -c user.email='bot@localhost' commit -m "generate" -q --allow-empty
scripts/generate.sh
script/generate.sh
[ -z "$(git status --porcelain)" ] || {
msg="Generated files are out of date. Please run scripts/generate.sh and commit the results"
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
Expand Down
4 changes: 2 additions & 2 deletions scripts/lint.sh → script/lint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
#/ scripts/lint.sh runs linters and validates generated files.
#/ script/lint.sh runs linters and validates generated files.

set -e

Expand Down Expand Up @@ -31,7 +31,7 @@ for dir in $MOD_DIRS; do
) || FAILED=1
done

scripts/generate.sh --check || FAILED=1
script/generate.sh --check || FAILED=1

if [ -n "$FAILED" ]; then
exit 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh → script/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
#/ scripts/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation.
#/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation.
#/ "-race -covermode atomic ./..." is used when no arguments are given.

set -e
Expand Down

0 comments on commit 13c9ed3

Please sign in to comment.