Use golangci-lint to lint zerolog (#2524)

This commit is contained in:
qwerty287 2023-10-04 15:48:56 +02:00 committed by GitHub
parent 8791e64557
commit 7136ca1999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View file

@ -33,6 +33,7 @@ linters:
- gofumpt - gofumpt
- errorlint - errorlint
- forbidigo - forbidigo
- zerologlint
run: run:
timeout: 5m timeout: 5m

View file

@ -117,9 +117,6 @@ install-tools: ## Install development tools
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \ go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \
fi ; \ fi ; \
hash lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install github.com/rs/zerolog/cmd/lint@latest; \
fi ; \
hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install mvdan.cc/gofumpt@latest; \ go install mvdan.cc/gofumpt@latest; \
fi ; \ fi ; \
@ -139,10 +136,6 @@ ui-dependencies: ## Install UI dependencies
lint: install-tools ## Lint code lint: install-tools ## Lint code
@echo "Running golangci-lint" @echo "Running golangci-lint"
golangci-lint run --timeout 15m golangci-lint run --timeout 15m
@echo "Running zerolog linter"
lint github.com/woodpecker-ci/woodpecker/cmd/agent
lint github.com/woodpecker-ci/woodpecker/cmd/cli
lint github.com/woodpecker-ci/woodpecker/cmd/server
lint-ui: ## Lint UI code lint-ui: ## Lint UI code
(cd web/; pnpm install) (cd web/; pnpm install)