-
Notifications
You must be signed in to change notification settings - Fork 212
51 lines (51 loc) · 1.54 KB
/
golangci-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: golangci-lint
on:
push:
tags:
- v*
branches:
# $default-branch
- master
- 'release-*'
- 'dev-*'
pull_request:
merge_group:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
strategy:
matrix:
mode: [no-failure]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '>=1.20'
cache: false
check-latest: true
# https://github.com/golangci/golangci-lint/issues/3862#issuecomment-1572973588
- run: echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=3m
${{ matrix.mode == 'no-deprecations' && '--exclude=^SA1019' || '' }}
${{ matrix.mode == 'no-failure' && '--issues-exit-code=0' || '' }}
# for pull requests, show only new issues
# Too bad it's incompatible with working-directory.
# only-new-issues: true
only-new-issues: false
working-directory: ./golang/cosmos
- name: forbid %w error-wrapping format specifier
run: |
set -e
if find ./golang/cosmos -name '*.go' ! -name '*_test.go' -print0 | xargs -0 grep '%w'; then
echo "Found %w in ./golang/cosmos; please use %s instead."
exit 1
fi