-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6307c76
commit 5db4923
Showing
10 changed files
with
147 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
linters-settings: | ||
govet: | ||
check-shadowing: true | ||
misspell: | ||
locale: US | ||
exhaustive: | ||
default-signifies-exhaustive: true | ||
gomodguard: | ||
blocked: | ||
modules: | ||
- github.com/pkg/errors: | ||
recommendations: | ||
- errors | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- blank | ||
- dot | ||
custom-order: true | ||
|
||
linters: | ||
enable: | ||
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers | ||
- bodyclose # checks whether HTTP response body is closed successfully | ||
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) | ||
- dupl # Tool for code clone detection | ||
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases | ||
- exhaustive # check exhaustiveness of enum switch statements | ||
- exportloopref # checks for pointers to enclosing loop variables | ||
- gochecknoglobals # Checks that no globals are present in Go code | ||
- gochecknoinits # Checks that no init functions are present in Go code | ||
- gocognit # Computes and checks the cognitive complexity of functions | ||
- goconst # Finds repeated strings that could be replaced by a constant | ||
- gocritic # The most opinionated Go source code linter | ||
- godox # Tool for detection of FIXME, TODO and other comment keywords | ||
- goerr113 # Golang linter to check the errors handling expressions | ||
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification | ||
- goheader # Checks is file header matches to pattern | ||
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports | ||
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. | ||
- gosec # Inspects source code for security problems | ||
- gosimple # Linter for Go source code that specializes in simplifying a code | ||
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string | ||
- ineffassign # Detects when assignments to existing variables are not used | ||
- misspell # Finds commonly misspelled English words in comments | ||
- nakedret # Finds naked returns in functions greater than a specified function length | ||
- noctx # noctx finds sending http request without context.Context | ||
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint | ||
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks | ||
- stylecheck # Stylecheck is a replacement for golint | ||
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code | ||
- unconvert # Remove unnecessary type conversions | ||
- unparam # Reports unused function parameters | ||
- unused # Checks Go code for unused constants, variables, functions and types | ||
- whitespace # Tool for detection of leading and trailing whitespace | ||
disable: | ||
- deadcode # Finds unused code | ||
- depguard # Go linter that checks if package imports are in a list of acceptable packages | ||
- funlen # Tool for detection of long functions | ||
- gci # Gci control golang package import order and make it always deterministic. | ||
- gocyclo # Computes and checks the cyclomatic complexity of functions | ||
- godot # Check if comments end in a period | ||
- gofumpt # Gofumpt checks whether code was gofumpt-ed. | ||
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes | ||
- gomnd # An analyzer to detect magic numbers. | ||
- goprintffuncname # Checks that printf-like functions are named with `f` at the end | ||
- lll # Reports long lines | ||
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted | ||
- nestif # Reports deeply nested if statements | ||
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity | ||
- nolintlint # Reports ill-formed or insufficient nolint directives | ||
- prealloc # Finds slice declarations that could potentially be preallocated | ||
- rowserrcheck # checks whether Err of rows is checked successfully | ||
- scopelint # Scopelint checks for unpinned variables in go programs | ||
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. | ||
- structcheck # Finds unused struct fields | ||
- testpackage # linter that makes you use a separate _test package | ||
- varcheck # Finds unused global variables and constants | ||
- wsl # Whitespace Linter - Forces you to use empty lines! | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude-rules: | ||
# Allow complex tests, better to be self contained | ||
- path: _test\.go | ||
linters: | ||
- gocognit | ||
- noctx | ||
- errcheck | ||
- bodyclose | ||
- goerr113 | ||
- goconst | ||
|
||
# Allow complex main function in examples | ||
- path: examples | ||
text: "of func `main` is high" | ||
linters: | ||
- gocognit | ||
|
||
# Allow some DB mock rules | ||
- path: dbmock\.go | ||
linters: | ||
- revive | ||
- goerr113 | ||
- goconst | ||
|
||
run: | ||
skip-dirs-use-default: false | ||
skip-dirs: | ||
- examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[default.extend-words] | ||
#OpenSIPS = "OpenSIPS" | ||
|
||
[default.extend-identifiers] | ||
# this just isn't worth the cost of fixing | ||
exten = "exten" | ||
Exten = "Exten" | ||
|
||
#[files] | ||
#extend-exclude = ["*_test.go", "mock.go"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,7 @@ docmd: | |
clean: | ||
rm -f coverage.out | ||
go clean | ||
|
||
lint: | ||
typos --config=.typos.toml | ||
golangci-lint run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
module github.com/staskobzar/goagi | ||
|
||
go 1.18 | ||
go 1.22 | ||
|
||
require github.com/stretchr/testify v1.7.1 | ||
require github.com/stretchr/testify v1.9.0 | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.0 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= | ||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= | ||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |