Skip to content

Commit

Permalink
Merge pull request #10 from aserto-dev/refactor
Browse files Browse the repository at this point in the history
Refactor and bump deps
  • Loading branch information
ronenh authored Nov 14, 2024
2 parents e6ce5b2 + d8bcd66 commit ae2cee0
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 307 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: ci

on:
Expand All @@ -14,10 +15,8 @@ on:
- main
- release-*
env:
PRE_RELEASE: ${{ github.ref == 'refs/heads/main' && 'development' || '' }}
GO_VERSION: "1.22"
GO_RELEASER_VERSION: "v1.24.0"
GO_LANGCI_LINT_VERSION: "v1.56.2"
GO_VERSION: "1.23"
GO_LANGCI_LINT_VERSION: "v1.61.0"
GO_TESTSUM_VERSION: "1.11.0"

jobs:
Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:
name: Test
run: |
gotestsum --format short-verbose -- -count=1 -v -timeout=240s -coverprofile=cover.out -coverpkg=./... ./...
-
-
name: Upload code coverage
uses: shogo82148/actions-goveralls@v1
continue-on-error: true
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gitleaks-check.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: gitleaks-check

on: [pull_request]
Expand All @@ -6,10 +7,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
-
-
uses: actions/checkout@v4
with:
fetch-depth: 0
-
-
name: gitleaks-check
uses: aserto-dev/gitleaks-action@master
133 changes: 70 additions & 63 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@
# https://github.com/golangci/golangci/wiki/Configuration

linters-settings:
depguard:
list-type: blacklist
packages:
# logging is allowed only by zerolog
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by zerolog"
dupl:
threshold: 100
funlen:
lines: 100
statements: 80
gci:
local-prefixes: github.com/golangci/golangci-lint
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -28,7 +17,7 @@ linters-settings:
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
Expand All @@ -37,108 +26,126 @@ linters-settings:
min-complexity: 18
goimports:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
mnd:
checks:
- argument
- case
- condition
- return
govet:
check-shadowing: true
shadow: true
settings:
printf:
funcs:
- (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
maligned:
suggest-new: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
disable-all: false
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
- dogsled
- errcheck
- exportloopref
- dupword
- durationcheck
- err113
- errchkjson
- errname
- errorlint
- exhaustive
- fatcontext
- forcetypeassert
- funlen
- gocheckcompilerdirectives
- gochecknoinits
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- goerr113
- gofmt
- goimports
- gomoddirectives
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- gosmopolitan
- grouper
- importas
- inamedparam
- interfacebloat
- intrange
- lll
- makezero
- mirror
- misspell
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- nonamedreturns
- perfsprint
- prealloc
- predeclared
- reassign
- rowserrcheck
- staticcheck
- stylecheck
- testpackage
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- wsl
- zerologlint

# don't enable:
# don't enable:
# - depguard
# - dupl
# - exhaustruct
# - gci
# - ginkgolinter
# - gochecknoglobals
# - gocognit
# - godox
# - gomnd
# - gofumpt
# - ireturn
# - lll
# - nestif
# - nlreturn
# - nolintlint # conflict with 1.19 gofmt changes
# - protogetter
# - prealloc
# - revive
# - wsl
# - whitespace
# - wrapcheck

issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from 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:
- declaration of "(err|ctx)" shadows declaration at
- shadow of imported from 'github.com/stretchr/testify/assert' package 'assert'
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd
# https://github.com/go-critic/go-critic/issues/926
- text: "unnecessaryDefer:"
linters:
- gocritic
- text: "unnamedResult:"
linters:
- gocritic
- text: "G404"
linters:
- gosec

- gocritic
Loading

0 comments on commit ae2cee0

Please sign in to comment.