Skip to content

Commit 354ba98

Browse files
authored
ci(github): run uber-go/nilaway (#173)
* ci(github): run uber-go/nilaway https://github.com/uber-go/nilaway Signed-off-by: Gyuho Lee <[email protected]> * lint update Signed-off-by: Gyuho Lee <[email protected]> * golangci add nilaway Signed-off-by: Gyuho Lee <[email protected]> * update Signed-off-by: Gyuho Lee <[email protected]> * fix Signed-off-by: Gyuho Lee <[email protected]> --------- Signed-off-by: Gyuho Lee <[email protected]>
1 parent d2c8ad3 commit 354ba98

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

.custom-gcl.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# https://github.com/uber-go/nilaway
2+
# https://github.com/golangci/golangci-lint/releases/tag/v1.61.0
3+
4+
# This has to be >= v1.57.0 for module plugin system support.
5+
version: v1.61.0
6+
plugins:
7+
- module: "go.uber.org/nilaway"
8+
import: "go.uber.org/nilaway/cmd/gclplugin"
9+
version: latest # Or a fixed version for reproducible builds.

.github/workflows/golangci-lint.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@ jobs:
2525
- uses: actions/checkout@v4
2626
with:
2727
submodules: recursive
28+
2829
- uses: actions/setup-go@v5
2930
with:
3031
cache: false
3132
go-version-file: go.mod
32-
- name: golangci-lint
33-
uses: golangci/golangci-lint-action@v3
34-
with:
35-
args: --config=.golangci.yml -v
33+
34+
- name: Install golangci-lint
35+
run: go install github.com/golangci/golangci-lint/cmd/[email protected]
36+
37+
- name: Build custom golangci-lint
38+
run: golangci-lint custom
39+
40+
- name: Run golangci-lint
41+
run: ./custom-gcl run --verbose --config=.golangci.yml ./...

.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,28 @@ linters-settings:
1010
gofmt:
1111
# simplify code: gofmt with `-s` option, true by default
1212
simplify: true
13+
1314
goimports:
1415
# put imports beginning with prefix after 3rd-party packages;
1516
# it's a comma-separated list of prefixes
1617
local-prefixes: lepton.ai/lepton
18+
1719
misspell:
1820
# Correct spellings using locale preferences for US or UK.
1921
# Default is to use a neutral variety of English.
2022
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
2123
locale: US
2224

25+
custom:
26+
# ref. https://github.com/uber-go/nilaway
27+
nilaway:
28+
type: "module"
29+
description: Static analysis tool to detect potential nil panics in Go code.
30+
settings:
31+
include-pkgs: "github.com/leptonai/gpud"
32+
exclude-pkgs: "github.com/leptonai/gpud/third_party"
33+
experimental-anonymous-function: "true"
34+
2335
linters:
2436
fast: false
2537
disable-all: true

custom-gcl

32.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)