From 33440ff9ebd72c4e58e736b2fe792dd1dc7addd5 Mon Sep 17 00:00:00 2001 From: Brandon Mitchell Date: Sat, 5 Mar 2022 09:32:02 -0500 Subject: [PATCH] Add markdown linting Signed-off-by: Brandon Mitchell --- .markdownlint.yml | 19 +++++++++++++++++++ CODE_OF_CONDUCT.md | 20 ++++++++++---------- Makefile | 11 +++++++++-- docs/README.md | 6 +++--- 4 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 .markdownlint.yml diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..01f625f --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,19 @@ +# all lists use a `-` +MD004: + style: dash + +# allow tabs in code blocks (for Go) +MD010: + code_blocks: false + +# disable line length, prefer one sentence per line for PRs +MD013: false + +# emphasis with underscore (`_emphasis_`) +MD049: + style: "underscore" + +# bold with asterisk (`**bold**`) +MD050: + style: "asterisk" + \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 113f71a..92ba58a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -18,23 +18,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities diff --git a/Makefile b/Makefile index 2fd4f97..7c5e154 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,9 @@ GO_BUILD_FLAGS=-ldflags "$(LD_FLAGS)" -tags nolegacy DOCKERFILE_EXT:=$(shell if docker build --help 2>/dev/null | grep -q -- '--progress'; then echo ".buildkit"; fi) DOCKER_ARGS=--build-arg "VCS_REF=$(VCS_REF)" GOPATH:=$(shell go env GOPATH) +PWD:=$(shell pwd) -.PHONY: all fmt vet test vendor binaries docker artifacts artifact-pre plugin-user plugin-host .FORCE +.PHONY: all fmt vet test lint lint-go lint-md vendor binaries docker artifacts artifact-pre plugin-user plugin-host .FORCE .FORCE: @@ -30,9 +31,15 @@ vet: test: go test -cover ./... -lint: $(GOPATH)/bin/staticcheck +lint: lint-go lint-md + +lint-go: $(GOPATH)/bin/staticcheck .FORCE $(GOPATH)/bin/staticcheck -checks all ./... +lint-md: .FORCE + docker run --rm -v "$(PWD):/workdir:ro" ghcr.io/igorshubovych/markdownlint-cli:latest \ + --ignore vendor . + vendor: go mod vendor diff --git a/docs/README.md b/docs/README.md index 0f4a500..6eb92d4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -88,7 +88,7 @@ The following functions have been added in addition to the defaults available in Experimentally, the API call has been added to take a token and run the tag delete against `hub.docker.com` instead of `docker.io`. To implement this, add the following section to the `~/.regctl/config.json`: - ```json + ```jsonc { "hosts": { "hub.docker.com": { @@ -108,11 +108,11 @@ The following functions have been added in addition to the defaults available in A: If your `$HOME/.docker/config.json` includes a section like the following: - ```json + ```jsonc "credHelpers": { "gcr.io": "gcr", "public.ecr.aws": "ecr-login", - }, + } ``` These will work with standalone binaries or with the alpine image variants.