.golangci.yml (3054B)
1 # Configuration file for golangci-lint linter. 2 # This will be automatically picked up when golangci-lint is invoked. 3 # For all config options, see https://golangci-lint.run/usage/configuration/#config-file 4 # 5 # For GoToSocial we mostly take the default linters, but we add a few to catch style issues as well. 6 7 # options for analysis running 8 run: 9 # include test files or not, default is true 10 tests: false 11 # timeout for analysis, e.g. 30s, 5m, default is 1m 12 timeout: 5m 13 14 linters: 15 # enable some extra linters, see here for the list: https://golangci-lint.run/usage/linters/ 16 enable: 17 - forcetypeassert 18 - goconst 19 - gocritic 20 - gofmt 21 - goheader 22 - gosec 23 - nilerr 24 - revive 25 26 # https://golangci-lint.run/usage/linters/#linters-configuration 27 linters-settings: 28 # https://golangci-lint.run/usage/linters/#goheader 29 goheader: 30 template: |- 31 GoToSocial 32 Copyright (C) GoToSocial Authors admin@gotosocial.org 33 SPDX-License-Identifier: AGPL-3.0-or-later 34 35 This program is free software: you can redistribute it and/or modify 36 it under the terms of the GNU Affero General Public License as published by 37 the Free Software Foundation, either version 3 of the License, or 38 (at your option) any later version. 39 40 This program is distributed in the hope that it will be useful, 41 but WITHOUT ANY WARRANTY; without even the implied warranty of 42 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 43 GNU Affero General Public License for more details. 44 45 You should have received a copy of the GNU Affero General Public License 46 along with this program. If not, see <http://www.gnu.org/licenses/>. 47 # https://golangci-lint.run/usage/linters/#govet 48 govet: 49 disable: 50 - composites 51 # https://golangci-lint.run/usage/linters/#revive 52 revive: 53 rules: 54 # Enable most default rules. 55 # See: https://github.com/mgechev/revive/blob/master/defaults.toml 56 - name: blank-imports 57 - name: context-as-argument 58 - name: context-keys-type 59 - name: dot-imports 60 - name: error-naming 61 - name: error-return 62 - name: error-strings 63 - name: exported 64 - name: if-return 65 - name: increment-decrement 66 - name: var-naming 67 - name: var-declaration 68 - name: package-comments 69 - name: range 70 - name: receiver-naming 71 - name: time-naming 72 - name: unexported-return 73 - name: indent-error-flow 74 - name: errorf 75 - name: empty-block 76 - name: superfluous-else 77 - name: unreachable-code 78 # Disable below rules. 79 - name: redefines-builtin-id 80 disabled: true # This one is just annoying. 81 - name: unused-parameter 82 disabled: true # We often pass parameters to fulfil interfaces. 83 # https://golangci-lint.run/usage/linters/#staticcheck 84 staticcheck: 85 # Enable all checks, but disable SA1012: nil context passing. 86 # See: https://staticcheck.io/docs/configuration/options/#checks 87 checks: ["all", "-SA1012"]