Fix linter config.

This commit is contained in:
2025-11-15 13:16:30 -08:00
parent fd9f9f6d66
commit 928c643d8d
2 changed files with 53 additions and 82 deletions

View File

@@ -1,3 +1,5 @@
version: "2"
run: run:
timeout: 5m timeout: 5m
tests: true tests: true
@@ -25,63 +27,58 @@ linters:
- revive - revive
- typecheck - typecheck
linters-settings: settings:
gocyclo: gocyclo:
min-complexity: 15 min-complexity: 15
goconst: goconst:
min-len: 3 min-len: 3
min-occurrences: 3 min-occurrences: 3
misspell: revive:
locale: US rules:
- name: exported
disabled: false
- name: error-return
- name: error-naming
- name: if-return
- name: var-naming
- name: package-comments
disabled: true
- name: indent-error-flow
- name: context-as-argument
revive: gosec:
rules: excludes:
- name: exported - G304 # File path from variable (common in file utilities)
disabled: false - G404 # Use of weak random (acceptable for non-crypto use)
- name: error-return
- name: error-naming
- name: if-return
- name: var-naming
- name: package-comments
disabled: true
- name: indent-error-flow
- name: context-as-argument
gosec: issues:
excludes: exclude-rules:
- G304 # File path from variable (common in file utilities) # Exclude some linters from running on tests files
- G404 # Use of weak random (acceptable for non-crypto use) - path: _test\.go
linters:
- gocyclo
- errcheck
- gosec
issues: # Exclude embedded content from checks
exclude-rules: - path: ".*\\.txt$"
# Exclude some linters from running on tests files linters:
- path: _test\.go - all
linters:
- gocyclo
- errcheck
- gosec
# Exclude embedded content from checks # Ignore deprecation warnings in legacy code if needed
- path: ".*\\.txt$" - linters:
linters: - staticcheck
- all text: "SA1019"
# Ignore deprecation warnings in legacy code if needed # Maximum issues count per one linter
- linters: max-issues-per-linter: 0
- staticcheck
text: "SA1019"
# Maximum issues count per one linter # Maximum count of issues with the same text
max-issues-per-linter: 0 max-same-issues: 0
# Maximum count of issues with the same text
max-same-issues: 0
output: output:
formats: formats:
- format: colored-line-number text:
path: stdout colors: false
print-issued-lines: true
print-linter-name: true

View File

@@ -1,26 +0,0 @@
arch:
- amd64
- ppc64le
sudo: false
language: go
go:
- tip
- 1.9
jobs:
exclude:
- go: 1.9
arch: amd64
- go: 1.9
arch: ppc64le
script:
- go get golang.org/x/lint/golint
- go get golang.org/x/tools/cmd/cover
- go get github.com/kisom/goutils/...
- go test -cover github.com/kisom/goutils/...
- golint github.com/kisom/goutils/...
notifications:
email:
recipients:
- coder@kyleisom.net
on_success: change
on_failure: change