Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: format Go code by autofix.ci #991

Merged
merged 8 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: autofix.ci
on: pull_request
permissions: {}
jobs:
autofix:
runs-on: ubuntu-24.04
permissions: {}
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
with:
aqua_version: v2.43.0

# go mod tidy
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- run: go mod tidy

# gofumpt
- name: Get changed Go files
id: changed-files
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
with:
use_rest_api: "true"
files: |
**/*.go
- run: |
# shellcheck disable=SC2086
gofumpt -l -w $ALL_CHANGED_FILES
if: steps.changed-files.outputs.all_changed_files_count != '0'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}

- uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1
19 changes: 0 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,6 @@ jobs:
path: |
./build/

tidy:
name: Tidy Go Modules
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
id: go

- uses: j0hnsmith/go-mod-check@v1
with:
working-directory: ${{ github.workspace }}
# optional, only if you're happy to have `replace ` lines in your go.mod file
skip-replace-check: true

# run acceptance tests
test:
name: Acceptance Tests
Expand Down
14 changes: 14 additions & 0 deletions aqua/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:
- import: imports/*.yaml
2 changes: 2 additions & 0 deletions aqua/imports/gofumpt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- name: mvdan/[email protected]