diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..4ffadcc --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,30 @@ +run: + timeout: 5m + +linters-settings: + goimports: + local-prefixes: "plemya-x.ru/alr" + gofmt: + simplify: true + gofumpt: + extra-rules: true + +linters: + enable: + - gofmt + - gofumpt + - goimports + - gocritic + - govet + - staticcheck + - unused + - errcheck + - typecheck +# - forbidigo + +issues: + fix: true + exclude-rules: + - path: _test\.go + linters: + - errcheck \ No newline at end of file diff --git a/Makefile b/Makefile index 1c9d92e..1f2bb5f 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ INSTALLED_BASH_COMPLETION := $(DESTDIR)$(PREFIX)/share/bash-completion/completio INSTALLED_ZSH_COMPLETION := $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_$(NAME) ADD_LICENSE_BIN := go run github.com/google/addlicense@4caba19b7ed7818bb86bc4cd20411a246aa4a524 +GOLANGCI_LINT_BIN := go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2 .PHONY: build install clean clear uninstall check-no-root @@ -56,3 +57,6 @@ IGNORE_OLD_FILES := $(foreach file,$(shell cat old-files),-ignore $(file)) update-license: $(ADD_LICENSE_BIN) -v -f license-header-old-files.tmpl $(OLD_FILES) $(ADD_LICENSE_BIN) -v -f license-header.tmpl $(IGNORE_OLD_FILES) . + +fmt: + $(GOLANGCI_LINT_BIN) run --fix