Skip to content

Commit 0c4eb1d

Browse files
committed
Borrowed some good linting bits from Nexodus
Signed-off-by: Anil Kumar Vishnoi <[email protected]>
1 parent df0b379 commit 0c4eb1d

File tree

4 files changed

+60
-2
lines changed

4 files changed

+60
-2
lines changed

Diff for: .github/workflows/lint-jobs.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: linters
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- '**/*.md'
8+
pull_request:
9+
branches: ["main"]
10+
paths:
11+
- '**/*.md'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
markdown-lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: markdownlint-cli2-action
23+
uses: DavidAnson/markdownlint-cli2-action@v15
24+
with:
25+
globs: '**/*.md'

Diff for: .markdownlint-cli2.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
config:
2+
line-length: false
3+
no-emphasis-as-header: false
4+
first-line-heading: false
5+
code-block-style: false
6+
no-duplicate-header: false
7+
single-trailing-newline: false
8+
globs:
9+
- "**/*.md"
10+
ignores:
11+
- "pkg"
12+
- "**/node_modules/*"
13+
- "**/node_modules/**"

Diff for: CODE_OF_CONDUCT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ members of the project's leadership.
6767

6868
## Attribution
6969

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
70+
This [Code of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)
71+
is adapted from the [Contributor Covenant][homepage], version 1.4.
7272

7373
[homepage]: https://www.contributor-covenant.org

Diff for: Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.PHONY: help
2+
help:
3+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-18s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
4+
5+
#
6+
# If you want to see the full commands, run:
7+
# NOISY_BUILD=y make
8+
#
9+
ifeq ($(NOISY_BUILD),)
10+
ECHO_PREFIX=@
11+
CMD_PREFIX=@
12+
else
13+
ECHO_PREFIX=@\#
14+
CMD_PREFIX=
15+
endif
16+
17+
.PHONY: md-lint
18+
md-lint: ## Lint markdown files
19+
$(ECHO_PREFIX) printf " %-12s ./...\n" "[MD LINT]"
20+
$(CMD_PREFIX) docker run --rm -v $(CURDIR):/workdir docker.io/davidanson/markdownlint-cli2:v0.6.0 > /dev/null

0 commit comments

Comments
 (0)