From 406ab5886197fd82adb808149da9f5dd682145fb Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 18 Aug 2021 19:15:47 +0200 Subject: [PATCH] pre-commit: Switch to markdownlint-cli2 to avoid Ruby dependency --- .markdownlint-cli2.yaml | 38 ++++++++++++++++++++++++++++++++++++++ .mdlrc | 1 - .mdlstyle.rb | 21 --------------------- .pre-commit-config.yaml | 7 +++---- 4 files changed, 41 insertions(+), 26 deletions(-) create mode 100644 .markdownlint-cli2.yaml delete mode 100644 .mdlrc delete mode 100644 .mdlstyle.rb diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 00000000000..e42d18e03da --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,38 @@ +# +# An example .markdownlint-cli2.yaml file +# + +# Disable some built-in rules +config: + default: true + + # The same headline in different nested sections is okay (and necessary for + # CHANGELOG.md). + no-duplicate-header: + allow_different_nesting: true + + # We use ordered lists to make stuff easier to read in a text editor. + ol-prefix: + style: ordered + + # Not wrapping long lines makes diffs easier to read, especially for prose. + # Instead, we should follow the "one sentence per line" pattern. + line-length: false + + # Dollar signs are useful to indicate shell commands/type and help + # distinguishing wrapped lines from new commands. + commands-show-output: false + + # Indented code blocks are easier to read in a text editor, but don't allow + # specifying a language for syntax highlighting. Therefore both indented and + # fenced code block should be allowed depending on the use case. + code-block-style: false + +# Fix any fixable errors +fix: true + +# Disable inline config comments +noInlineConfig: true + +# Disable progress on stdout (only valid at root) +noProgress: true diff --git a/.mdlrc b/.mdlrc deleted file mode 100644 index f0cd338a4e0..00000000000 --- a/.mdlrc +++ /dev/null @@ -1 +0,0 @@ -style "#{File.dirname(__FILE__)}/.mdlstyle.rb" diff --git a/.mdlstyle.rb b/.mdlstyle.rb deleted file mode 100644 index ea70843a73c..00000000000 --- a/.mdlstyle.rb +++ /dev/null @@ -1,21 +0,0 @@ -all - -# The same headline in different nested sections is okay (and necessary for -# CHANGELOG.md). -rule 'MD024', :allow_different_nesting => true - -# We use ordered lists to make stuff easier to read in a text editor. -rule 'MD029', :style => :ordered - -# Not wrapping long lines makes diffs easier to read, especially for prose. -# Instead, we should follow the "one sentence per line" pattern. -exclude_rule 'MD013' - -# Dollar signs are useful to indicate shell commands/type and help -# distinguishing wrapped lines from new commands. -exclude_rule 'MD014' - -# Indented code blocks are easier to read in a text editor, but don't allow -# specifying a language for syntax highlighting. Therefore both indented and -# fenced code block should be allowed depending on the use case. -exclude_rule 'MD046' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b55c6c22ae5..5c82b23c677 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,11 +95,10 @@ repos: rev: v0.7.2.1 hooks: - id: shellcheck -- repo: https://github.com/markdownlint/markdownlint - rev: v0.11.0 +- repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.2.0 hooks: - - id: markdownlint - language_version: 2.6.6 + - id: markdownlint-cli2 - repo: local hooks: - id: qsscheck