Skip to content

Commit

Permalink
ci: check if code is formatted using gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 29, 2025
1 parent 020e9dd commit dabf540
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ jobs:
path: |
./build/
fmt:
name: Check if code is formatted
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: aquaproj/[email protected]
with:
aqua_version: v2.43.0
- name: Install gofumpt
run: gofumpt -version
- name: Check if code is formatted
run: |
git ls-files | grep -E "\.go$" | xargs gofumpt -l -w
if ! git diff --quiet; then
echo "::error:: Code isn't formatted. Please format code using gofumpt"
exit 1
fi
tidy:
name: Tidy Go Modules
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions aqua.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
# checksum:
# enabled: true
# require_checksum: true
# supported_envs:
# - all
registries:
- type: standard
ref: v4.302.1 # renovate: depName=aquaproj/aqua-registry
packages:
- name: mvdan/[email protected]

0 comments on commit dabf540

Please sign in to comment.