EnergySystemsModellingLab / MUSE_OS

Welcome to the MUSE-OS repository
https://muse-os.readthedocs.io/en/latest/
GNU General Public License v3.0
22 stars 8 forks source link

`markdownlint-cli` `pre-commit` hook is broken [BUG] #275

Closed alexdewar closed 2 months ago

alexdewar commented 2 months ago

Describe the bug

The markdownlint-cli is currently broken and has been since we changed over from the previous Ruby-based hook in 35dcc2f472a52733fa9f6e2ea793bad55fcb713f.

The problem is that the list of warnings following the --disable flag must be terminated with a --, otherwise markdownlint a) fails to run and b) fails to report that it has failed to run to developers. We've hit this bug elsewhere.

Unfortunately a bunch of new warnings have sprung up since this change:

.github/ISSUE_TEMPLATE/bug_report.md:10 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Describe the bug"]
.github/ISSUE_TEMPLATE/bug_report.md:13 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
.github/ISSUE_TEMPLATE/bug_report.md:14 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## To Reproduce"]
.github/ISSUE_TEMPLATE/bug_report.md:17 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
.github/ISSUE_TEMPLATE/bug_report.md:18 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Expected behavior"]
.github/ISSUE_TEMPLATE/bug_report.md:21 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Screenshots"]
.github/ISSUE_TEMPLATE/feature_request.md:10 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Is your feature request related to a problem? Please describe."]
.github/ISSUE_TEMPLATE/feature_request.md:10:65 MD026/no-trailing-punctuation Trailing punctuation in heading [Punctuation: '.']
.github/ISSUE_TEMPLATE/feature_request.md:13 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Describe the solution you'd like"]
.github/ISSUE_TEMPLATE/feature_request.md:16 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Describe alternatives you've considered"]
.github/ISSUE_TEMPLATE/feature_request.md:19 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Additional context"]
.github/ISSUE_TEMPLATE/usage-support.md:14 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
.github/ISSUE_TEMPLATE/usage-support.md:19 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
README.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "[![PyPI version shields.io](ht..."]
(node:236084) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
CHANGELOG.md:62:40 MD034/no-bare-urls Bare URL used [Context: "https://github.com/SGIModel/MU..."]
CHANGELOG.md:63:63 MD034/no-bare-urls Bare URL used [Context: "https://github.com/SGIModel/MU..."]
src/muse/data/README.md:2:1 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 4]
src/muse/data/README.md:3 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## default"]
src/muse/data/README.md:9 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## default_timeslice"]
src/muse/data/README.md:10:42 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
src/muse/data/README.md:13 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## medium"]
src/muse/data/README.md:14:42 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
src/muse/data/README.md:17 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## multiple_agents"]
src/muse/data/README.md:21 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## minimum_service"]
src/muse/data/README.md:27 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## trade"]
src/muse/data/README.md:34 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
src/muse/data/README.md:35 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]
src/muse/data/README.md:36 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 4]
(node:236083) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

To Reproduce

Fix the command-line arguments as above then run the markdownlint hook: pre-commit run markdownlint -a

alexdewar commented 2 months ago

The trailing spaces will be dealt with by my open PR: #274

alexdewar commented 2 months ago

NB: It seems that we can fix this by changing the hook id from markdownlint to markdownlint-fix then re-running it. Let's just do this :smile: