Skip to content

Commit

Permalink
Add precommit hook for markdownlint (#1038)
Browse files Browse the repository at this point in the history
Signed-off-by: kwanhur <[email protected]>
  • Loading branch information
kwanhur authored Apr 28, 2022
1 parent 8e134e4 commit d8f1d3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ repos:
rev: c3086eea8af86847dbdff2e46b85a5fe3c9d9656
hooks:
- id: go-static-check

- 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

0 comments on commit d8f1d3e

Please sign in to comment.