Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(precommit): add markdownlint hook #1038

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ repos:
- id: go-vet
- id: go-unit-tests
- id: go-build
- repo: /~https://github.com/igorshubovych/markdownlint-cli
rev: v0.31.1
hooks:
- id: markdownlint
- id: markdownlint-fix
18 changes: 0 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ GOINSTALL := $(GO) install
GOFLAGS := -race
STATICCHECK := staticcheck
LICENSEEYE := license-eye
MDLINT := markdownlint
PIP := pip3
PIPINSTALL := $(PIP) install
NPM := npm
NPMINSTALL := $(NPM) install

# init arch
ARCH := $(shell getconf LONG_BIT)
Expand Down Expand Up @@ -67,12 +64,6 @@ define PIP_INSTALL_PKG
@echo $(1) installed
endef

define NPM_INSTALL_PKG
@echo installing $(1)
$(NPMINSTALL) $(1)
@echo $(1) installed
endef

# make, make all
all: prepare compile package

Expand Down Expand Up @@ -116,7 +107,6 @@ package:

# make deps
deps:
$(call NPM_INSTALL_PKG, markdownlint-cli)
$(call PIP_INSTALL_PKG, pre-commit)
$(call INSTALL_PKG, goyacc, golang.org/x/tools/cmd/goyacc)
$(call INSTALL_PKG, staticcheck, honnef.co/go/tools/cmd/staticcheck)
Expand All @@ -127,14 +117,6 @@ precommit:
pre-commit autoupdate
pre-commit install --install-hooks

# make mdlint
mdlint:
$(MDLINT) --ignore $(WORKROOT)/**/testdata/**/*.md $(WORKROOT)

# make mdlint-fix
mdlint-fix:
$(MDLINT) --fix --ignore $(WORKROOT)/**/testdata/**/*.md $(WORKROOT)

# make check
check:
$(STATICCHECK) ./...
Expand Down