forked from TrueCloudLab/basic
Compare commits
2 commits
fedaf59bb8
...
f0376ee1e3
Author | SHA1 | Date | |
---|---|---|---|
f0376ee1e3 | |||
9d574a3aa4 |
5 changed files with 61 additions and 10 deletions
|
@ -41,11 +41,6 @@ linters-settings:
|
|||
truecloudlab-linters:
|
||||
path: bin/linters/external_linters.so
|
||||
original-url: git.frostfs.info/TrueCloudLab/linters.git
|
||||
settings:
|
||||
noliteral:
|
||||
target-methods : ["reportFlushError", "reportError"]
|
||||
disable-packages: ["codes", "err", "res","exec"]
|
||||
constants-package: "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
|
||||
linters:
|
||||
enable:
|
||||
|
|
19
mk/fumpt.mk
Normal file
19
mk/fumpt.mk
Normal file
|
@ -0,0 +1,19 @@
|
|||
BIN ?= bin
|
||||
GOFUMPT_VERSION ?= v0.7.0
|
||||
GOFUMPT_DIR ?= $(abspath $(BIN))/gofumpt
|
||||
GOFUMPT_VERSION_DIR ?= $(GOFUMPT_DIR)/$(GOFUMPT_VERSION)
|
||||
|
||||
.PHONY: fumpt fumpt-install
|
||||
|
||||
# Install gofumpt
|
||||
fumpt-install:
|
||||
@rm -rf $(GOFUMPT_DIR)
|
||||
@mkdir $(GOFUMPT_DIR)
|
||||
@GOBIN=$(GOFUMPT_VERSION_DIR) go install mvdan.cc/gofumpt@$(GOFUMPT_VERSION)
|
||||
|
||||
$(GOFUMPT_VERSION_DIR): fumpt-install
|
||||
|
||||
# Run gofumpt
|
||||
fumpt: $(GOFUMPT_VERSION_DIR)
|
||||
@echo "⇒ Processing gofumpt check"
|
||||
$(GOFUMPT_VERSION_DIR)/gofumpt -l -w cmd/ pkg/ misc/
|
24
mk/gopls.mk
Normal file
24
mk/gopls.mk
Normal file
|
@ -0,0 +1,24 @@
|
|||
BIN ?= bin
|
||||
GOPLS_VERSION ?= v0.15.1
|
||||
GOPLS_DIR ?= $(abspath $(BIN))/gopls
|
||||
GOPLS_VERSION_DIR ?= $(GOPLS_DIR)/$(GOPLS_VERSION)
|
||||
GOPLS_TEMP_FILE := $(shell mktemp)
|
||||
|
||||
.PHONY: gopls-install gopls-run
|
||||
|
||||
# Install gopls
|
||||
gopls-install:
|
||||
@rm -rf $(GOPLS_DIR)
|
||||
@mkdir $(GOPLS_DIR)
|
||||
@GOBIN=$(GOPLS_VERSION_DIR) go install golang.org/x/tools/gopls@$(GOPLS_VERSION)
|
||||
|
||||
$(GOPLS_VERSION_DIR): gopls-install
|
||||
|
||||
# Run gopls
|
||||
gopls-run: $(GOPLS_VERSION_DIR)
|
||||
$(GOPLS_VERSION_DIR)/gopls check $(SOURCES) 2>&1 >$(GOPLS_TEMP_FILE)
|
||||
@if [[ $$(wc -l < $(GOPLS_TEMP_FILE)) -ne 0 ]]; then \
|
||||
cat $(GOPLS_TEMP_FILE); \
|
||||
exit 1; \
|
||||
fi
|
||||
rm $(GOPLS_TEMP_FILE)
|
|
@ -23,8 +23,3 @@ $(LINT_DIR):
|
|||
# Run linters
|
||||
lint: $(LINT_DIR)
|
||||
$(LINT_DIR)/golangci-lint run
|
||||
|
||||
# Run gofumpt
|
||||
fumpt:
|
||||
@echo "⇒ Processing gofumpt check"
|
||||
@gofumpt -l -w cmd/ pkg/ misc/
|
18
mk/staticcheck.mk
Normal file
18
mk/staticcheck.mk
Normal file
|
@ -0,0 +1,18 @@
|
|||
BIN ?= bin
|
||||
STATICCHECK_VERSION ?= 2024.1.1
|
||||
STATICCHECK_DIR ?= $(abspath $(BIN))/staticcheck
|
||||
STATICCHECK_VERSION_DIR ?= $(STATICCHECK_DIR)/$(STATICCHECK_VERSION)
|
||||
|
||||
.PHONY: staticcheck-install staticcheck-run
|
||||
|
||||
# Install staticcheck
|
||||
staticcheck-install:
|
||||
@rm -rf $(STATICCHECK_DIR)
|
||||
@mkdir $(STATICCHECK_DIR)
|
||||
@GOBIN=$(STATICCHECK_VERSION_DIR) go install honnef.co/go/tools/cmd/staticcheck@$(STATICCHECK_VERSION)
|
||||
|
||||
$(STATICCHECK_VERSION_DIR): staticcheck-install
|
||||
|
||||
# Run staticcheck
|
||||
staticcheck-run: $(STATICCHECK_VERSION_DIR)
|
||||
@$(STATICCHECK_VERSION_DIR)/staticcheck ./...
|
Loading…
Reference in a new issue