summaryrefslogtreecommitdiffstats
path: root/.golangci.yml
blob: fd7393372be41295cb93d4d587c2177ae61f3514 (plain)
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
linters:
  enable:
    - gosimple
    - deadcode
    - typecheck
    - govet
    - errcheck
    - staticcheck
    - unused
    - structcheck
    - varcheck
    - golint
    - dupl
    #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
    - gofmt
    - misspell
    - gocritic
  enable-all: false
  disable-all: true
  fast: false

run:
  timeout: 3m

linters-settings:
  gocritic:
    disabled-checks:
      - ifElseChain
      - singleCaseSwitch # Every time this occured in the code, there  was no other way.

issues:
  exclude-rules:
    # Exclude some linters from running on tests files.
    - path: _test\.go
      linters:
        - gocyclo
        - errcheck
        - dupl
        - gosec
        - unparam
        - staticcheck
    - path: models/migrations/v
      linters:
        - gocyclo
        - errcheck
        - dupl
        - gosec
    - linters:
        - dupl
      text: "webhook"
    - linters:
        - gocritic
      text: "`ID' should not be capitalized"
    - path: modules/templates/helper.go
      linters:
        - gocritic
    - linters:
        - unused
        - deadcode
      text: "swagger"
    - path: contrib/pr/checkout.go
      linters:
        - errcheck
    - path: models/issue.go
      linters:
        - errcheck
    - path: models/migrations/
      linters:
        - errcheck
    - path: modules/log/
      linters:
        - errcheck
    - path: routers/routes/routes.go
      linters:
        - dupl
    - path: routers/repo/view.go
      linters:
        - dupl
    - path: models/migrations/
      linters:
        - unused
    - linters:
        - staticcheck
      text: "argument x is overwritten before first use"
    - path: modules/httplib/httplib.go
      linters:
        - staticcheck
    # Enabling this would require refactoring the methods and how they are called.
    - path: models/issue_comment_list.go
      linters:
        - dupl
    - linters:
        - misspell
      text: '`Unknwon` is a misspelling of `Unknown`'