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

chore: add markdownlint to lint commands #9353

Merged
merged 11 commits into from
May 27, 2021
Prev Previous commit
Next Next commit
resuse docker container
  • Loading branch information
ryanchristo committed May 21, 2021
commit 676a11d01fcb19640b8fa8d5c17bf8d0f307c6fb
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,17 @@ benchmark:
### Linting ###
###############################################################################

containerMarkdownLintImage=tmknom/markdownlint
containerMarkdownLint=cosmos-sdk-markdownlint
containerMarkdownLintFix=cosmos-sdk-markdownlint-fix

lint:
golangci-lint run --out-format=tab
docker run --rm -i -v "$(CURDIR):/work" tmknom/markdownlint
if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage); fi

lint-fix:
golangci-lint run --fix --out-format=tab --issues-exit-code=0
docker run --rm -i -v "$(CURDIR):/work" tmknom/markdownlint . --fix
if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage) . --fix; fi

.PHONY: lint lint-fix

Expand Down