mirror of https://github.com/grafana/grafana.git
Chore: Use golanglint-ci-includes script in Makefile (#91742)
This commit is contained in:
parent
e20c7342a9
commit
27545e3da4
|
|
@ -27,6 +27,6 @@ jobs:
|
|||
with:
|
||||
version: v1.59.1
|
||||
args: |
|
||||
--config .golangci.toml --max-same-issues=0 --max-issues-per-linter=0 --verbose ./pkg/... $(./scripts/go-workspace/golangci-lint.sh)
|
||||
--config .golangci.toml --max-same-issues=0 --max-issues-per-linter=0 --verbose $(./scripts/go-workspace/golangci-lint-includes.sh)
|
||||
skip-cache: true
|
||||
install-mode: binary
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -9,7 +9,7 @@ include .bingo/Variables.mk
|
|||
|
||||
GO = go
|
||||
GO_VERSION = 1.22.4
|
||||
GO_FILES ?= $(shell $(GO) run ./scripts/go-workspace/main.go list-submodules --delimiter '/... ')
|
||||
GO_LINT_FILES ?= $(shell ./scripts/go-workspace/golangci-lint-includes.sh)
|
||||
SH_FILES ?= $(shell find ./scripts -name *.sh)
|
||||
GO_RACE := $(shell [ -n "$(GO_RACE)" -o -e ".go-race-enabled-locally" ] && echo 1 )
|
||||
GO_RACE_FLAG := $(if $(GO_RACE),-race)
|
||||
|
|
@ -289,10 +289,10 @@ golangci-lint: $(GOLANGCI_LINT)
|
|||
@echo "lint via golangci-lint"
|
||||
$(GOLANGCI_LINT) run \
|
||||
--config .golangci.toml \
|
||||
$(GO_FILES)
|
||||
$(GO_LINT_FILES)
|
||||
|
||||
.PHONY: lint-go
|
||||
lint-go: golangci-lint ## Run all code checks for backend. You can use GO_FILES to specify exact files to check
|
||||
lint-go: golangci-lint ## Run all code checks for backend. You can use GO_LINT_FILES to specify exact files to check
|
||||
|
||||
# with disabled SC1071 we are ignored some TCL,Expect `/usr/bin/env expect` scripts
|
||||
.PHONY: shellcheck
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
|
||||
INCLUDES=$(go run scripts/go-workspace/main.go list-submodules --path "${REPO_ROOT}/go.work" --delimiter '/... ' --skip golangci-lint)
|
||||
|
||||
# ./pkg/... is manually added to cover the root package without including scripts and devenv
|
||||
printf './pkg/... %s' "${INCLUDES}"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
|
||||
|
||||
go run scripts/go-workspace/main.go list-submodules --path "${REPO_ROOT}/go.work" --delimiter '/... ' --skip golangci-lint
|
||||
Loading…
Reference in New Issue