Skip to content

Commit

Permalink
DEVOPS-6856 Add depguard config (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Szulik <[email protected]>
  • Loading branch information
Creatone authored Dec 14, 2023
1 parent a761708 commit ee5257d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions go/lint/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ linters-settings:
lll:
line-length: 120

depguard:
rules:
Main:
list-mode: lax
files:
- $all
- "!$test"
deny:
- pkg: reflect
desc: Please don't use reflect package
Test:
list-mode: lax
files:
- $test
deny:
- pkg: reflect
desc: Please don't use reflect package

linters:
disable-all: true
Expand All @@ -29,6 +46,7 @@ linters:
- gofmt
- gocognit
- dupl
- depguard
- whitespace
- goconst
- unconvert
Expand Down
2 changes: 1 addition & 1 deletion go/lint/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ runs:
with:
version: ${{ inputs.golangci-lint-version }}
# Extended timeout to ensure all the linters are installed before it hits
args: --concurrency ${{ inputs.golangci-lint-concurrency }} --exclude-use-default=false --timeout=${{ inputs.golangci-lint-timeout }}
args: --concurrency ${{ inputs.golangci-lint-concurrency }} --exclude-use-default=false --timeout=${{ inputs.golangci-lint-timeout }} -c ${{ github.action_path }}/.golangci.yml

- name: Run linters (with incremental improvements)
if: ${{ inputs.inclint == 'true' }}
Expand Down

0 comments on commit ee5257d

Please sign in to comment.