-
Notifications
You must be signed in to change notification settings - Fork 208
45 lines (45 loc) · 1.32 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
name: golangci-lint
on:
push:
tags:
- v*
branches:
# $default-branch
- master
- release-pismo
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
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
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
# 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