Skip to content

Commit

Permalink
Adding Lint Checker (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon authored Dec 3, 2024
1 parent 3221f76 commit 0d7b114
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/PR-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
- name: Check out code
if: needs.changes.outputs.lint == 'true'
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check format
if: needs.changes.outputs.lint == 'true'
Expand All @@ -67,7 +69,7 @@ jobs:
- name: Check license and imports
if: needs.changes.outputs.lint == 'true'
run: make simple-lint
run: make lint

build:
needs: [lint, changes]
Expand Down
14 changes: 8 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ output:

# All available settings of specific linters
linters-settings:
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0.7
gofmt:
# Simplify code: gofmt with `-s` option, true by default
simplify: true
Expand All @@ -49,12 +46,17 @@ linters-settings:
linters:
disable:
- errcheck
enable:
- gofmt
- goimports
enable:
- gosimple
- gosec
- unused
- gosimple
- govet
- ineffassign
- misspell
- revive
- unused
- nonamedreturns

issues:
new-from-rev: 3221f76
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ install-addlicense:
install-golangci-lint:
#Install from source for golangci-lint is not recommended based on https://golangci-lint.run/usage/install/#install-from-source so using binary
#installation
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v1.50.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v1.62.2

fmt: install-goimports addlicense
go fmt ./...
Expand Down

0 comments on commit 0d7b114

Please sign in to comment.