-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.golangci.yml
120 lines (98 loc) · 2.63 KB
/
.golangci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
# Ref: https://golangci-lint.run/usage/configuration/
linters:
enable-all: true
disable:
- cyclop # some functions need refactoring, I'll deal with that later
- exhaustruct # it's ok not to specify all the fields in a struct definition
- godox # I like leaving TODOs in the code
- testpackage # keep the tests close to the code
- varnamelen # short variable names are okay
# deprecated
- exportloopref
issues:
exclude-rules:
- path: _test.go
linters:
- bodyclose
- funlen
- revive
- path: internal/cmd
linters:
# using init() is recommended with spf13/cobra
- gochecknoinits
# using globals is recommended with spf13/cobra
- gochecknoglobals
- path: internal/repl
linters:
# returning interface is the way to work with charmbracelet/bubbletea
- ireturn
linters-settings:
nolintlint:
require-explanation: true
gci:
sections:
- standard
- default
- localmodule
mnd:
ignored-numbers:
# UNIX permissions mask
- "0o700" # rwx------
- "0o600" # rw-------
ignored-functions:
# Functions that require a UNIX permissions mask
- "os.WriteFile"
- "os.OpenFile"
- "os.MkdirAll"
depguard:
rules:
main:
files:
- $all
allow:
- $gostd
- github.com/cli/go-gh
- github.com/nobe4/gh-not
- github.com/charmbracelet/bubbletea
- github.com/charmbracelet/bubbles
- github.com/charmbracelet/lipgloss
- github.com/spf13/cobra
- github.com/spf13/viper
- github.com/itchyny/gojq
revive:
enable-all-rules: true
rules:
- name: add-constant
disabled: true
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T"
- name: comment-spacings
arguments:
- "nolint"
- name: cognitive-complexity
disabled: true # TODO: re enable to simplify functions
- name: cyclomatic
disabled: true # TODO: re enable to simplify functions
- name: max-public-structs
disabled: true # I might enable that later
- name: import-alias-naming
arguments:
- "^[a-z][A-Za-z0-9]{0,}$"
- name: line-length-limit
disabled: true # using lll
- name: unhandled-error
arguments:
- "fmt.Printf"
- "fmt.Println"
- "fmt.Fprint"
- "fmt.Fprintf"
- "fmt.Fprintln"
tagliatelle:
case:
rules:
json: snake
misspell:
locale: US
mode: default