Skip to content

Commit

Permalink
style: Add markdownlint configuration
Browse files Browse the repository at this point in the history
Add configuration files for markdownlint [1] and the related
markdownlint-cli2 [2]. Note that while the markdownlint-cli2
configuration file could include the configuration for markdownlint, it
is kept in a separate file, because for .markdownlint.yaml there is a
schema file which enables autocompletion in the IDE.

Prefer [1] over [3] which provides a comparable rules set, because the
former can easily be run locally with `npx markdownlint-cli2` which is
similar to `commitlint`, while the latter requires a working Ruby
installation. Also, chose `markdownlint-cli2` over `markdownlint-cli`
[4] for the reasons explained by the author in [5].

[1]: https://github.com/DavidAnson/markdownlint
[2]: https://github.com/DavidAnson/markdownlint-cli2
[3]: https://github.com/markdownlint/markdownlint
[4]: https://github.com/igorshubovych/markdownlint-cli
[5]: https://dlaa.me/blog/post/markdownlintcli2

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Jun 25, 2023
1 parent c2af3ea commit 2fb14ac
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Configuration for the markdownlint-cli2, see:
# https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml

globs:
- "**/*.md"
ignores:
- "**/node_modules/**"
- "**/projects/external/**"
- "**/multi-kotlin-project/**"
- "**/sbt-http4s-template/**"
- "**/stack-yesodweb-simple/**"
35 changes: 35 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Markdownlint configuration, see: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# For the list of rules see: https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases

# ul-style
MD004:
style: asterisk

# line-length
MD013:
code_blocks: false
line_length: 120
tables: false

# no-duplicate-heading
MD024: false # GitHub has no issues with anchors for headings with the same content.

# no-inline-html
MD033: false # Inline HTML is used for anchors in README.md where images are used in headings.

# no-bare-urls
MD034: false # GitHub has no issues with rendering bare URLs.

# fenced-code-language
MD040: false # It is not possible to always set a language, for example in case of config files using uncommon formats.

# first-line-heading
MD041: false # Some short README.md files do not require a heading.

# code-block-style
MD046:
style: fenced

# emphasis-style
MD049:
style: asterisk

0 comments on commit 2fb14ac

Please sign in to comment.