-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.golangci.yml
More file actions
55 lines (54 loc) · 2.56 KB
/
.golangci.yml
File metadata and controls
55 lines (54 loc) · 2.56 KB
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
version: "2"
linters:
# standard: [errcheck govet ineffassign staticcheck unused]
default: standard
enable:
- unconvert # 意味のない型変換チェック
- revive # golintの後継、Go標準コーディング規約
- misspell # スペルミスチェック
- bodyclose # HTTPレスポンスボディのclose忘れ防止
- goconst # 定数化可能な文字列/数値の検出
- unparam # 未使用パラメータ検出
- copyloopvar # ループ変数コピー問題検出(重要なバグ防止)
- prealloc # パフォーマンス最適化:スライス事前割り当て
- gocyclo # 循環複雑度チェック(テスタビリティ向上)
- nakedret # 裸のreturn文検出(可読性向上)
- nilerr # nilエラー処理の不備検出(重要なバグ防止)
- decorder # 宣言順序チェック(コード構造の一貫性)
- paralleltest # テストの並列実行(t.Parallel())推奨
- tparallel # t.Parallel()の不適切な使用検出
- depguard # 依存関係制御(禁止パッケージの使用防止)
- exhaustive # enum switch文の網羅性チェック(バグ防止)
# 現状と乖離が大きいので追加しない
# - testpackage # テストファイルの命名規約(テスト品質向上)
settings:
exhaustive:
check:
- switch
default-signifies-exhaustive: true # default句があれば網羅性を満たす
depguard:
rules:
deprecated_packages:
list-mode: lax
deny:
- pkg: "math/rand$"
desc: math/rand/v2 を使う
- pkg: "github.com/sirupsen/logrus"
desc: 標準ライブラリを使う
- pkg: "github.com/pkg/errors"
desc: 標準ライブラリを使う
- pkg: "github.com/hajimehoshi/ebiten$"
desc: ebiten/v2を使う
engine_guard:
list-mode: lax
files:
- "**/internal/engine/**"
- "!$test"
deny:
# 正確にmodule名である必要がある。ワイルドカードは使えない
- pkg: "github.com/kijimaD/ruins/internal/world"
desc: engineはworldに依存しない
- pkg: "github.com/kijimaD/ruins/internal/components"
desc: engineはcomponentsに依存しない
- pkg: "github.com/kijimaD/ruins/internal/resources"
desc: engineはresourcesに依存しない