Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalMinder committed Jul 19, 2022
1 parent 084ed3f commit 5957e3d
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 187 deletions.
45 changes: 0 additions & 45 deletions .golangci.toml

This file was deleted.

76 changes: 76 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# inspired by: https://github.com/golangci/golangci-lint/blob/master/.golangci.yml

run:
go: "1.18"

linters-settings:
# dupl:
# threshold: 100
funlen:
lines: 100
statements: 50
golint:
min-confidence: 0
lll:
line-length: 125
goconst:
min-len: 2
min-occurences: 2
misspell:
locale: US

linters:
disable-all: true
enable:
- asciicheck
# - bidichk
# - bodyclose
# - contextcheck
- deadcode
- depguard
- dogsled
# - dupl
# - durationcheck
- errcheck
# - errname
- exportloopref
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
# - ifshort
# - importas
- ineffassign
- lll
# - makezero
- misspell
- nakedret
# - nilerr
# - nilnil
# - noctx
- nolintlint
# - predeclared
# - revive
- staticcheck
- structcheck
- stylecheck
# - tagliatelle
# - thelper
- typecheck
- unconvert
- unparam
- unused
- varcheck
# - wastedassign
- whitespace

# don't enable:
# - prealloc
4 changes: 2 additions & 2 deletions .traefik.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
displayName: GeoBlock
type: middleware

import: github.com/PascalMinder/GeoBlock
import: github.com/PascalMinder/geoblock

summary: 'block request based on their country of origin'
summary: "block request based on their country of origin"

testData:
allowLocalRequests: false
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"stkb.rewrap",
"golang.go"
]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"[go]": {
"editor.tabSize": 4,
"editor.detectIndentation": false,
"editor.snippetSuggestions": "none",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"go.autocompleteUnimportedPackages": true,
"go.formatTool": "goimports",
"go.lintTool": "golangci-lint",
"go.buildOnSave": "workspace",
"go.lintOnSave": "workspace",
"go.vetOnSave": "package",
"gopls": {
"usePlaceholders": true, // add parameter placeholders when completing a function
// Experimental settings
"completeUnimported": true, // autocomplete unimported packages
"deepCompletion": true // enable deep completion
},
"go.useLanguageServer": true,
"cSpell.words": [
"geoblock"
]
}
Loading

0 comments on commit 5957e3d

Please sign in to comment.