Skip to content

Commit

Permalink
Add GitHub workflow for markdownlint (#101)
Browse files Browse the repository at this point in the history
* Add GitHub workflow for `markdownlint`

* Add `MD054` rule

* Add version numbers

* Simplify logic

- Only exclude `ŧranslated` files
- Only lint with `markdownlint-rule-titlecase`

* Lint all files, not only changed files

* Allow all HTML elements
  • Loading branch information
its-miroma authored Jun 15, 2024
1 parent fdd0662 commit fde5197
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run markdownlint

on:
pull_request:
branches:
- main
paths:
- '**/*.md'
- '!translated/**'
- '!versions/*/translated/**'
workflow_dispatch: # Manual run

concurrency:
group: markdownlint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
markdownlint:
runs-on: ubuntu-22.04

steps:
- id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- id: node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- id: titlecase
run: npm install [email protected]

- id: lint
uses: DavidAnson/markdownlint-cli2-action@v16
with:
config: .markdownlint-cli2.yaml
globs: |
**/*.md
!translated/**
!versions/*/translated/**
52 changes: 52 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Available configuration options: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
config:
MD003:
style: atx
MD004:
style: dash
MD007:
indent: 2
MD009:
br_spaces: 0
MD013: false
MD024:
siblings_only: true
MD025:
front_matter_title: ""
MD026:
# Allow headings to end with `!`
punctuation: ".,;:。,;:"
MD029:
style: ordered
MD033: false
MD035:
style: ---
MD044:
names:
- CurseForge
- Fabric
- GitHub
- Java
- Minecraft
- Modrinth
- Mojang
code_blocks: false
MD046:
style: fenced
MD048:
style: backtick
MD049:
style: underscore
MD050:
style: asterisk
MD053: false
MD054:
# these link styles are not easily localizable
collapsed: false # A link to [keyword][].
shortcut: false # A link to [keyword].
# [keyword]: <https://example.com>
url_inline: false
MD055:
style: leading_and_trailing
customRules:
- markdownlint-rule-titlecase

0 comments on commit fde5197

Please sign in to comment.