-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: improved testing job and added linting job (#25)
* fix: addressed cuddled decalarations * docs: re-arranged readme badges * chore: added golangci config file * ci: improving pipeline * ci: expanded strategy matrix * ci: run coverage only on master branch * ci: bumped go version * ci: revert to 1.19 * chore: added codeclimate config * chore: disabled golint as it is depricated
- Loading branch information
1 parent
6613e8d
commit 45a69df
Showing
6 changed files
with
238 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
version: "2" | ||
|
||
checks: | ||
argument-count: | ||
config: | ||
threshold: 4 | ||
complex-logic: | ||
config: | ||
threshold: 4 | ||
file-lines: | ||
config: | ||
threshold: 500 | ||
method-complexity: | ||
enabled: false | ||
config: | ||
threshold: 20 | ||
method-count: | ||
enabled: false | ||
config: | ||
threshold: 20 | ||
method-lines: | ||
enabled: false | ||
config: | ||
threshold: 50 | ||
nested-control-flow: | ||
config: | ||
threshold: 4 | ||
return-statements: | ||
config: | ||
threshold: 10 | ||
similar-code: | ||
config: | ||
threshold: # language-specific defaults. an override will affect all languages. | ||
identical-code: | ||
config: | ||
threshold: # language-specific defaults. an override will affect all languages. | ||
|
||
plugins: | ||
gofmt: | ||
enabled: true | ||
govet: | ||
enabled: true | ||
markdownlint: | ||
enabled: true | ||
shellcheck: | ||
enabled: true | ||
fixme: | ||
enabled: true | ||
config: | ||
strings: | ||
- FIXME | ||
- BUG | ||
- HACK | ||
|
||
exclude_patterns: | ||
- "config/" | ||
- "db/" | ||
- "dist/" | ||
- "features/" | ||
- "**/node_modules/" | ||
- "script/" | ||
- "**/spec/" | ||
- "**/test/" | ||
- "**/tests/" | ||
- "Tests/" | ||
- "**/vendor/" | ||
- "**/*_test.go" | ||
- "**/*.d.ts" | ||
- "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
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,120 @@ | ||
run: | ||
concurrency: 4 # number of concurrent linters | ||
deadline: 1m # timeout for analysis | ||
issues-exit-code: 1 # exit code when issues were found | ||
tests: true | ||
skip-dirs: | ||
- vendor$ | ||
|
||
output: | ||
format: colored-line-number | ||
print-issued-lines: true | ||
print-linter-name: true | ||
uniq-by-line: true | ||
sort-results: true | ||
|
||
linters-settings: | ||
errcheck: | ||
check-type-assertions: false # Check type assertions | ||
check-blank: false # Check assignments on blank identifiers | ||
|
||
govet: | ||
check-shadowing: true # Check for shadowed variables | ||
|
||
gofmt: | ||
simplify: true | ||
|
||
gosec: | ||
exclude-generated: false # Exclude files that were generated by the protocol buffer compiler | ||
severity: medium | ||
confidence: medium | ||
excludes: | ||
- G306 # Poor file permissions used when writing to a new file | ||
|
||
misspell: | ||
locale: US | ||
|
||
stylecheck: | ||
go: "1.19" | ||
checks: | ||
["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"] | ||
# https://staticcheck.io/docs/options#dot_import_whitelist | ||
dot-import-whitelist: | ||
- fmt | ||
# https://staticcheck.io/docs/options#initialisms | ||
initialisms: | ||
[ | ||
"ACL", | ||
"API", | ||
"ASCII", | ||
"CPU", | ||
"CSS", | ||
"DNS", | ||
"EOF", | ||
"GUID", | ||
"HTML", | ||
"HTTP", | ||
"HTTPS", | ||
"ID", | ||
"IP", | ||
"JSON", | ||
"QPS", | ||
"RAM", | ||
"RPC", | ||
"SLA", | ||
"SMTP", | ||
"SQL", | ||
"SSH", | ||
"TCP", | ||
"TLS", | ||
"TTL", | ||
"UDP", | ||
"UI", | ||
"GID", | ||
"UID", | ||
"UUID", | ||
"URI", | ||
"URL", | ||
"UTF8", | ||
"VM", | ||
"XML", | ||
"XMPP", | ||
"XSRF", | ||
"XSS", | ||
] | ||
# https://staticcheck.io/docs/options#http_status_code_whitelist | ||
http-status-code-whitelist: ["200", "400", "404", "500"] | ||
|
||
unused: | ||
# Select the Go version to target. The default is '1.13'. | ||
go: "1.19" | ||
|
||
whitespace: | ||
multi-if: true # Enforces newlines (or comments) after every multi-line if statement | ||
multi-func: true # Enforces newlines (or comments) after every multi-line function signature | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- deadcode | ||
- exhaustivestruct | ||
- exhaustruct | ||
- forbidigo | ||
- gochecknoinits | ||
- goerr113 | ||
- golint | ||
- gomnd | ||
- ifshort | ||
- interfacer | ||
- maligned | ||
- nosnakecase | ||
- paralleltest | ||
- rowserrcheck | ||
- scopelint | ||
- sqlclosecheck | ||
- structcheck | ||
- tparallel | ||
- varcheck | ||
- varnamelen | ||
- wastedassign | ||
- wrapcheck |
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