GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BeautifulGo/lints/.golangci.yml at main · brrock/BeautifulGo

Expand file tree

/

.golangci.yml

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
116 lines (111 loc) · 3.89 KB
/

.golangci.yml

Copy path

File metadata and controls

116 lines (111 loc) · 3.89 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# BeautifulGo drop-in golangci-lint config (v2 format).
#
# Copy this file to your module root as .golangci.yml and run:
#
# golangci-lint run
# golangci-lint fmt # rewrites files with gofmt and goimports
#
# It makes golangci-lint enforce the rules from the go-best-practices skill that a
# machine can check. Silence a finding on one line only, and say why:
#
# //nolint:gochecknoglobals // read-only lookup table built at init
#
# Linters marked [lib] fit packages other modules import; applications can drop them.
version: "2"
linters:
# errcheck, govet, ineffassign, staticcheck, unused.
default: standard
enable:
# Errors: wrap with %w, match with errors.Is/As, name them Err.../...Error.
- errorlint
- errname
# Panics: comma-ok type assertions.
- forcetypeassert
# Concurrency and context: no ctx in structs, ctx-aware calls, closed bodies.
- containedctx
- noctx
- bodyclose
# API design.
- ireturn # [lib] accept interfaces, return concrete types
- recvcheck # don't mix pointer and value receivers on one type
- embeddedstructfieldcheck # embedded fields first; never embed a mutex
- musttag # tag every field of a marshaled struct
- gochecknoglobals # no mutable package state (Err vars, regexps allowed)
- gochecknoinits # no init functions
- predeclared # don't shadow len, new, error, ...
- nakedret # naked returns only in short functions
# Modern Go, gated on the go directive in go.mod.
- modernize
- copyloopvar
- perfsprint # strconv over fmt.Sprint for simple conversions
# Tests.
- thelper
- usetesting # t.TempDir, t.Context, t.Setenv over hand-rolled versions
- testableexamples # examples have an // Output: comment
# Style rules from Code Review Comments.
- revive
# Suppressions must be specific and explain themselves.
- nolintlint
settings:
embeddedstructfieldcheck:
forbid-mutex: true
errcheck:
# Deferred Close on a file or body you only read is idiomatic. On a file you
# write, check the Close error yourself: that's where failed flushes show up.
exclude-functions:
- (*os.File).Close
- (io.ReadCloser).Close
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
govet:
enable:
- nilness
- shadow
settings:
shadow:
strict: false
nakedret:
max-func-lines: 10
nolintlint:
require-explanation: true
require-specific: true
revive:
rules:
# Go Code Review Comments and Effective Go, as revive implements them.
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: errorf
- name: exported # [lib] doc comments on exported names, no stutter
- name: package-comments # [lib]
- name: increment-decrement
- name: var-naming # initialisms: ID, URL, HTTP
- name: var-declaration
- name: range
- name: receiver-naming # short, consistent, never this/self
- name: time-naming
- name: unexported-return # [lib]
- name: indent-error-flow
- name: superfluous-else
- name: empty-block
- name: unreachable-code
- name: redefines-builtin-id
- name: use-any
# Beyond Code Review Comments.
- name: deep-exit # only main may call os.Exit or log.Fatal
- name: flag-parameter # no bool parameters that switch behavior
exclusions:
rules:
- path: _test\.go
linters:
- gochecknoglobals
- forcetypeassert
formatters:
enable:
- gofmt
- goimports
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.