Skip to content

Commit

Permalink
Merge pull request #1389 script for run linters local
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby authored Aug 1, 2024
2 parents c645d88 + 22c89f7 commit c78681e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/golangci-lint-gen-configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/slo/g' .golangci.yml > tests/slo/.golangci.yml
sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/examples/g' .golangci.yml > examples/.golangci.yml
5 changes: 5 additions & 0 deletions .github/scripts/golangci-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
./.github/scripts/golangci-lint-gen-configs.sh
golangci-lint run -c .golangci.yml ./...
golangci-lint run -c examples/.golangci.yml ./examples/...
golangci-lint run -c tests/slo/.golangci.yml ./tests/slo/...
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: generate examples golangci-lint config
run: sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/examples/g' .golangci.yml > examples/.golangci.yml
run: ./.github/scripts/golangci-lint-gen-configs.sh
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
Expand All @@ -47,7 +47,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: generate slo golangci-lint config
run: sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/slo/g' .golangci.yml > tests/slo/.golangci.yml
run: ./.github/scripts/golangci-lint-gen-configs.sh
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.22.x"
- name: Install utilities
run: |
go install mvdan.cc/[email protected]
Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.golangci.yml
1 change: 1 addition & 0 deletions tests/slo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.golangci.yml

0 comments on commit c78681e

Please sign in to comment.