From ff481446075f834161eda09560bc515e30c38148 Mon Sep 17 00:00:00 2001
From: Max Gautier <mg@max.gautier.name>
Date: Tue, 28 May 2024 10:08:30 +0200
Subject: [PATCH] pre-commit: adjust mardownlint default, md fixes

Use a style file as recommended by upstream. This makes for only one
source of truth.
Conserve previous upstream default for MD007 (upstream default changed
here https://github.com/markdownlint/markdownlint/pull/373)
---
 .markdownlint.yaml                       | 3 ---
 .md_style.rb                             | 4 ++++
 .mdlrc                                   | 1 +
 .pre-commit-config.yaml                  | 3 +--
 docs/cloud_providers/openstack.md        | 1 -
 docs/operations/recover-control-plane.md | 1 -
 6 files changed, 6 insertions(+), 7 deletions(-)
 delete mode 100644 .markdownlint.yaml
 create mode 100644 .md_style.rb
 create mode 100644 .mdlrc

diff --git a/.markdownlint.yaml b/.markdownlint.yaml
deleted file mode 100644
index 8ece4c761..000000000
--- a/.markdownlint.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-MD013: false
-MD029: false
diff --git a/.md_style.rb b/.md_style.rb
new file mode 100644
index 000000000..73adf8ae4
--- /dev/null
+++ b/.md_style.rb
@@ -0,0 +1,4 @@
+all
+exclude_rule 'MD013'
+exclude_rule 'MD029'
+rule 'MD007', :indent => 2
diff --git a/.mdlrc b/.mdlrc
new file mode 100644
index 000000000..8ca55a8ce
--- /dev/null
+++ b/.mdlrc
@@ -0,0 +1 @@
+style "#{File.dirname(__FILE__)}/.md_style.rb"
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5b2f78f7a..d79a716ad 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -24,8 +24,7 @@ repos:
     rev: v0.11.0
     hooks:
       - id: markdownlint
-        args: [-r, "~MD013,~MD029"]
-        exclude: "^.git"
+        exclude: "^.github|(^docs/_sidebar\\.md$)"
 
   - repo: https://github.com/shellcheck-py/shellcheck-py
     rev: v0.10.0.1
diff --git a/docs/cloud_providers/openstack.md b/docs/cloud_providers/openstack.md
index 6f53da534..1506be370 100644
--- a/docs/cloud_providers/openstack.md
+++ b/docs/cloud_providers/openstack.md
@@ -1,4 +1,3 @@
-
 # OpenStack
 
 ## Known compatible public clouds
diff --git a/docs/operations/recover-control-plane.md b/docs/operations/recover-control-plane.md
index c54808b41..d54aa13f5 100644
--- a/docs/operations/recover-control-plane.md
+++ b/docs/operations/recover-control-plane.md
@@ -1,4 +1,3 @@
-
 # Recovering the control plane
 
 To recover from broken nodes in the control plane use the "recover\-control\-plane.yml" playbook.
-- 
GitLab