diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 000000000..c7a4c10d2 --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -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 markdownlint-rule-titlecase@v0.1.0 + + - id: lint + uses: DavidAnson/markdownlint-cli2-action@v16 + with: + config: .markdownlint-cli2.yaml + globs: | + **/*.md + !translated/** + !versions/*/translated/** diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 000000000..b975b5f38 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -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]: + url_inline: false + MD055: + style: leading_and_trailing +customRules: + - markdownlint-rule-titlecase