Dan Anglin
71d62ecaf6
Add golangci-lint for linting and refactor the code based on the feedback from running it. Changes: - Add configuration for golangci-lint. - Break the large function in create.go into smaller ones. - Rename internal/templateFuncs to internal/templatefuncs to remove upper case letters in the package name. - Add a mage target for lint tests.
55 lines
1 KiB
YAML
55 lines
1 KiB
YAML
---
|
|
run:
|
|
concurrency: 2
|
|
timeout: 1m
|
|
issues-exit-code: 1
|
|
tests: true
|
|
modules-download-mode: readonly
|
|
|
|
output:
|
|
format: colored-line-number
|
|
print-issues-lines: true
|
|
print-linter-name: true
|
|
uniq-by-line: true
|
|
sort-results: true
|
|
|
|
linters:
|
|
enable-all: true
|
|
disable:
|
|
- exhaustruct
|
|
- exhaustivestruct # (deprecated)
|
|
- golint # (deprecated)
|
|
- ifshort # (deprecated)
|
|
- scopelint # (deprecated)
|
|
- maligned # (deprecated)
|
|
- deadcode # (deprecated)
|
|
- nosnakecase # (deprecated)
|
|
- interfacer # (deprecated)
|
|
- varcheck # (deprecated)
|
|
- structcheck # (deprecated)
|
|
fast: false
|
|
|
|
linters-settings:
|
|
depguard:
|
|
rules:
|
|
main:
|
|
files:
|
|
- $all
|
|
allow:
|
|
- $gostd
|
|
- codeflow.dananglin.me.uk/apollo/spruce
|
|
lll:
|
|
line-length: 140
|
|
|
|
issues:
|
|
exclude-rules:
|
|
- path: cmd/spruce/main.go
|
|
linters:
|
|
- gochecknoglobals
|
|
- path: cmd/spruce-docgen/main.go
|
|
linters:
|
|
- gochecknoglobals
|
|
- cyclop
|
|
- path: internal/cmd/generate.go
|
|
linters:
|
|
- gomnd
|