Skip to content

Commit

Permalink
improvement(lint): do not lint all the installed packages
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Malusev <[email protected]>
  • Loading branch information
CodeLieutenant committed Sep 3, 2024
1 parent 6e8b491 commit eb10a0e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
40 changes: 35 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
run:
concurrency: 8
timeout: 10m
issues-exit-code: 1
tests: true
modules-download-mode: mod
allow-parallel-runners: true
go: '1.23'


output:
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
sort-results: true

issues:
max-same-issues: 1
max-issues-per-linter: 50
new: true
exclude:
- Error return value of `.*.Unlock` is not checked
- Error return value of `.*.Completed` is not checked
linters:
disable-all: true
enable:
- asasalint
- bidichk
- errcheck
- govet
- bodyclose
- ineffassign
- unused
- durationcheck
- goheader
- goimports
- misspell
- gofumpt
- gosimple
- staticcheck
- decorder
- lll
- errorlint
- gocritic
Expand All @@ -25,16 +49,22 @@ linters:
- tparallel
- typecheck
- unused
run:
deadline: 10m
modules-download-mode: readonly
- gomodguard
- gocyclo
- nilerr
- makezero
- wastedassign
- prealloc


linters-settings:
govet:
check-shadowing: true
settings:
shadow:
strict: true
enable-all: true
gocyclo:
min-complexity: 50
lll:
line-length: 180
goheader:
Expand Down Expand Up @@ -64,8 +94,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.'

gofumpt:
lang-version: "1.12"
extra-rules: true
goimports:
local-prefixes: github.com/scylladb/gemini
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ $(GOBIN)/golangci-lint: Makefile

.PHONY: check-golangci
check-golangci: $(GOBIN)/golangci-lint
@echo $(GOPACKAGES) | sed -e 's/github.com\/scylladb\/gemini/./g' | \
xargs $(GOBIN)/golangci-lint run --max-issues-per-linter=0 --max-same-issues=0
$(GOBIN)/golangci-lint run --max-issues-per-linter=0 --max-same-issues=0

# fix-golangci Automated fix for golangci-lint errors.
.PHONY: fix-golangci
Expand Down

0 comments on commit eb10a0e

Please sign in to comment.