Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from ZupIT/develop
Browse files Browse the repository at this point in the history
Refactor 2.0
  • Loading branch information
wiliansilvazup authored Jun 23, 2021
2 parents 6c9fb40 + 54eccc3 commit 66fdeda
Show file tree
Hide file tree
Showing 128 changed files with 5,012 additions and 4,193 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Coverage
on:
pull_request:
branches: ["**"]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- name: coverage
run: make coverage
44 changes: 0 additions & 44 deletions .github/workflows/install-build-test-fmt-lint.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint
on:
pull_request:
branches: ["**"]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: lint
run: make lint
15 changes: 0 additions & 15 deletions .github/workflows/security.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Security
on:
pull_request:
branches: ["**"]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: security
run: make security
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Test
on:
pull_request:
branches: ["**"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- name: test
run: make test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
# Test binary, built with `go test -c`
*.test

.horusec

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
*tmp*

# Dependency directories
vendor/
Expand Down
157 changes: 90 additions & 67 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
linters-settings:
depguard:
list-type: blacklist
packages:
packages-with-error-message:
dupl:
threshold: 100
funlen:
lines: 15
statements: 10
gci:
local-prefixes: github.com/ZupIT/horusec-admin
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport
- octalLiteral
- whyNoLint
- wrapperFunc
- evalOrder
- unnamedResult
gocyclo:
min-complexity: 10
goimports:
local-prefixes: github.com/ZupIT/horusec-admin
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
govet:
check-shadowing: true
settings:
Expand All @@ -8,106 +47,90 @@ linters-settings:
- (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
golint:
min-confidence: 0.8
gocyclo:
min-complexity: 5
lll:
line-length: 120
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
packages-with-error-messages:
github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
misspell:
locale: US
lll:
line-length: 120
goimports:
local-prefixes: github.com/golangci/golangci-lint
gocritic:
enabled-tags:
- opinionated
- experimental
- diagnostic
- style
- performance
disabled-checks:
- evalOrder
- wrapperFunc
- unnamedResult
- octalLiteral
- dupImport
funlen:
lines: 15
statements: 10
nolintlint:
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
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
enable:
- dogsled
- bodyclose
- deadcode
- depguard
- bodyclose
- funlen
- errcheck
- dogsled
- dupl
- gocritic
- errcheck
- exportloopref
- exhaustive
- funlen
- gochecknoinits
- goconst
- gofmt
- gocritic
- gocyclo
- gosec
- gofmt
- goimports
- golint
- ineffassign
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- interfacer
- nakedret
- misspell
- nakedret
- noctx
- nolintlint
- rowserrcheck
- staticcheck
- scopelint
- stylecheck
- structcheck
- unconvert
- stylecheck
- typecheck
- unused
- unconvert
- unparam
- whitespace
- unused
- varcheck
- whitespace

# don't enable:
# - asciicheck
# - scopelint
# - gochecknoglobals
# - gocognit
# - godot
# - godox
# - goerr113
# - interfacer
# - maligned
# - nestif
# - prealloc
# - testpackage
# - revive
# - wsl

issues:
exclude-rules:
- linters:
- lll
source: "^// "

run:
skip-dirs:
- vendor/
- examples/
- tmp
- e2e/
- pkg/client
- pkg/api
- pkg
skip-files:
- .*_test.go
- .*_mock.go

issues:
exclude-rules:
- linters:
- lll
source: "^// "

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: v1.21.0 # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
4 changes: 4 additions & 0 deletions .semver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
alpha: 1
beta: 0
rc: 0
release: v2.0.0
Loading

0 comments on commit 66fdeda

Please sign in to comment.