Skip to content

Commit

Permalink
Samlaf avs 538 make lint and fmt checks as part of ci (#275)
Browse files Browse the repository at this point in the history
* add workflow to enforce make fmt to be run

* update lint workflow to use same version actions as other workflows

* make fmt
  • Loading branch information
samlaf authored Jun 26, 2024
1 parent 68ca900 commit bf693ea
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/check-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: check that make fmt was run
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
check-make-fmt:
name: check make fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install go1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Run make fmt
run: make fmt

- name: Check if make fmt generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make fmt generated changes that should be committed. Please run 'make fmt' and commit the changes."
git diff
git status
exit 1
fi
11 changes: 7 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4

- name: install go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 3m
args: --timeout 3m
2 changes: 1 addition & 1 deletion chainio/clients/avsregistry/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type AvsRegistryWriter interface {
// - operatorToAvsRegistrationSigExpiry is the expiry time of the signature
//
// Deprecated: use RegisterOperator instead.
// We will only keep high-level functionality such as RegisterOperator, and low level functionality
// We will only keep high-level functionality such as RegisterOperator, and low level functionality
// such as this function should eventually all be done with bindings directly instead.
RegisterOperatorInQuorumWithAVSRegistryCoordinator(
ctx context.Context,
Expand Down

0 comments on commit bf693ea

Please sign in to comment.