Skip to content

Commit

Permalink
Merge pull request #61 from bytemare/update-workflows
Browse files Browse the repository at this point in the history
update workflows
  • Loading branch information
bytemare committed May 17, 2024
2 parents dc0a608 + d8a9d10 commit 446e100
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 273 deletions.
137 changes: 96 additions & 41 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,94 @@ linters:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
#- depguard
- dogsled
- dupl
- durationcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- fatcontext
- forbidigo
- forcetypeassert
- funlen
#- gci
- gci
- ginkgolinter
- gocheckcompilerdirectives
#- gochecknoglobals
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
#- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
- ireturn
- lll
- logrlint
- loggercheck
- maintidx
- makezero
- mirror
- misspell
#- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnil
#- nlreturn
- nlreturn
- noctx
- nolintlint
#- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
Expand All @@ -90,20 +106,31 @@ linters:
- whitespace
- wrapcheck
- wsl
presets:
- bugs
- unused
fast: false
- zerologlint

linters-settings:
dupl:
threshold: 100
errcheck:
check-type-assertions: true
check-blank: true
#errcheck:
# check-type-assertions: true
# check-blank: true
# exclude-functions:
# - io.ReadFull
exhaustive:
ignore-enum-types: "hash.Hash"
funlen:
lines: 100
statements: 50
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/bytemare/hash2curve) # Custom section: groups all imports with the specified Prefix.
skip-generated: true
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
gocognit:
min-complexity: 15
goconst:
Expand All @@ -129,32 +156,48 @@ linters-settings:
simplify: true
goimports:
local-prefixes: github.com/bytemare/hash2curve
gomnd:
settings:
mnd:
checks:
- argument
- case
- condition
- operation
- return
- assign
gosimple:
checks: [ "all" ]
govet:
check-shadowing: true

# settings per analyzer
settings:
printf: # analyzer name, run `go tool vet help` to see all analyzers
funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf

# enable or disable analyzers by name
shadow: true
disable-all: true
enable:
- asmdecl
- assign
- atomic
- atomicalign
disable-all: false
- bools
- buildtag
- cgocall
- composites
- copylocks
- deepequalerrors
- errorsas
- fieldalignment
- findcall
- framepointer
- httpresponse
- ifaceassert
- loopclosure
- lostcancel
- nilfunc
- nilness
- printf
- reflectvaluecompare
- shadow
- shift
- sigchanyzer
- sortslice
- stdmethods
- stringintconv
- structtag
- testinggoroutine
- tests
- unmarshal
- unreachable
- unsafeptr
- unusedresult
- unusedwrite
lll:
line-length: 120
# tab width ('\t') in spaces. Default to 1.
Expand All @@ -163,6 +206,18 @@ linters-settings:
suggest-new: true
misspell:
locale: US
mnd:
checks:
- argument
- condition
- return
- assign
#ignored-functions:
# - 'nist.setMapping'
# - 'big.NewInt'
# - 'hash2curve.HashToFieldXMD'
nlreturn:
block-size: 2
prealloc:
simple: false
for-loops: true
Expand All @@ -185,13 +240,13 @@ linters-settings:

issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# But independently of this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- "should have a package comment, unless it's in another file for this package"

#exclude-rules:
#exclude-rules:
#- path: internal/hash.go
# linters:
# - errcheck
Expand All @@ -202,7 +257,7 @@ issues:
max-issues-per-linter: 0
max-same-issues: 0

# Independently from option `exclude` we use default exclude patterns,
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
Expand All @@ -211,5 +266,5 @@ issues:
run:
tests: false

#output:
# format: github-actions
output:
formats: github-actions
8 changes: 8 additions & 0 deletions .github/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sonar.organization=bytemare
sonar.projectKey=bytemare_hash2curve
sonar.sources=.
sonar.tests=tests/
sonar.test.exclusions=examples_test.go,tests/**
sonar.verbose=true
sonar.coverage.exclusions=examples_test.go,tests/**
sonar.go.coverage.reportPaths=.github/coverage.out

0 comments on commit 446e100

Please sign in to comment.