Skip to content

Commit

Permalink
[AUTOPR] Automatic updates (#38)
Browse files Browse the repository at this point in the history
* Update Go linter config and simplify code

---------

Co-authored-by: nicolaasuni-vonage <nicola.asuni@vonage.com>
  • Loading branch information
github-actions[bot] and nicolaasuni-vonage authored Jul 3, 2024
1 parent fa9ad72 commit 5c869b6
Show file tree
Hide file tree
Showing 15 changed files with 3,068 additions and 2,810 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.9
1.6.10
2 changes: 1 addition & 1 deletion c/doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME = "NumKey"
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 1.6.9
PROJECT_NUMBER = 1.6.10

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
Expand Down
72 changes: 72 additions & 0 deletions cgo/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# https://golangci-lint.run/usage/configuration/
# To get the list of available linters: ./target/binutil/golangci-lint help linters

run:
issues-exit-code: 1
tests: true
timeout: 5m
skip-dirs-use-default: true

output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
formats: colored-line-number

linters-settings:
funlen:
lines: 100
statements: 50
ignore-comments: true
gocognit:
min-complexity: 10
gocyclo:
min-complexity: 10
gofmt:
simplify: true
misspell:
locale: US
whitespace:
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
depguard:
rules:
main:
files:
- $all
- "!$test"
allow:
- $gostd
- github.com/Vonage
test:
files:
- "$test"
allow:
- $gostd
- github.com/stretchr

issues:
exclude-dirs:
- .github
- .githook
exclude-rules:
- path: _test.go
linters:
- dupl
- funlen
# fix: true

linters:
enable-all: true
disable:
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false]
- exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false]
- err113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false]
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
- ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false]
- lll # Reports long lines [fast: true, auto-fix: false]
- mnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
- musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false]
- nlreturn # Accept Nil, Return Non-Nil [fast: false, auto-fix: false]
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false]
- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
2 changes: 1 addition & 1 deletion cgo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ format:
# Execute multiple linter tools
.PHONY: linter
linter:
$(GOLANGCILINT) run $(SRCDIR)/...
$(GOLANGCILINT) run --exclude-use-default=false --max-issues-per-linter 0 --max-same-issues 0 $(SRCDIR)/...

.PHONY: mod
mod:
Expand Down
Loading

0 comments on commit 5c869b6

Please sign in to comment.