Add super-linter
+ fix lint issues (#650)
* feat: bump `golangci-lint`, add `super-linter`, replace outdated linter Bump `golangci-lint` version. Add `super-linter` to lint other languages. Go linter is disabled because it's currently broken: https://github.com/github/super-linter/pull/370 Replacing `scopelint` with `exportloopref`: "[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." Fixed formatting in `.golangci.yml` Add addtional linters: `misspell`: purely style, detects typos in comments `whitespace`: detects leading and trailing whitespace `goimports`: it's gofmt + checks unused imports * fix: lint/fix `go` files * fix: lint with `standardjs` * fix: lint/fix with `markdownlint`, make template more verbose * feat: add lint stuff to makefile * fix: `UseGitIgnore` formatting * fix: lint/fix `README.md` Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
47
Makefile
47
Makefile
@@ -6,8 +6,17 @@ MINOR_VERSION = $(word 2, $(subst ., ,$(VERSION)))
|
||||
PATCH_VERSION = $(word 3, $(subst ., ,$(word 1,$(subst -, , $(VERSION)))))
|
||||
NEW_VERSION ?= $(MAJOR_VERSION).$(MINOR_VERSION).$(shell echo $$(( $(PATCH_VERSION) + 1)) )
|
||||
|
||||
fix = false
|
||||
ifeq (true,$(fix))
|
||||
FIX = --fix
|
||||
endif
|
||||
|
||||
ACT ?= go run main.go
|
||||
export GITHUB_TOKEN := $(shell cat ~/.config/github/token)
|
||||
|
||||
HAS_TOKEN = $(if $(test -e ~/.config/github/token),true,false)
|
||||
ifeq (true,$(HAS_TOKEN))
|
||||
export GITHUB_TOKEN := $(shell cat ~/.config/github/token)
|
||||
endif
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
@@ -22,6 +31,42 @@ test:
|
||||
go test ./...
|
||||
$(ACT)
|
||||
|
||||
.PHONY: lint-go
|
||||
lint-go:
|
||||
golangci-lint run $(FIX)
|
||||
|
||||
.PHONY: lint-js
|
||||
lint-js:
|
||||
standard $(FIX)
|
||||
|
||||
.PHONY: lint-md
|
||||
lint-md:
|
||||
markdownlint . $(FIX)
|
||||
|
||||
.PHONY: lint-rest
|
||||
lint-rest:
|
||||
docker run --rm -it \
|
||||
-e 'RUN_LOCAL=true' \
|
||||
-e 'FILTER_REGEX_EXCLUDE=.*testdata/*' \
|
||||
-e 'VALIDATE_BASH=false' \
|
||||
-e 'VALIDATE_DOCKERFILE=false' \
|
||||
-e 'VALIDATE_DOCKERFILE_HADOLINT=false' \
|
||||
-e 'VALIDATE_GO=false' \
|
||||
-e 'VALIDATE_JSCPD=false' \
|
||||
-e 'VALIDATE_SHELL_SHFMT=false' \
|
||||
-v $(PWD):/tmp/lint \
|
||||
github/super-linter
|
||||
|
||||
.PHONY: lint
|
||||
lint: lint-go lint-rest
|
||||
|
||||
.PHONY: lint-fix
|
||||
lint-fix: lint-md lint-go
|
||||
|
||||
.PHONY: fix
|
||||
fix:
|
||||
make lint-fix fix=true
|
||||
|
||||
.PHONY: install
|
||||
install: build
|
||||
@cp dist/local/act $(PREFIX)/bin/act
|
||||
|
Reference in New Issue
Block a user