- Notifications
You must be signed in to change notification settings - Fork237
Description
When getting hit with this on a markdown file, having a long list of lines to check is tedious, eg:
github-actions.md:44: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:46: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:47: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:49: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:50: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:51: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:369: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:373: MD005 Inconsistent indentation for list items at the same levelgithub-actions.md:382: MD005 Inconsistent indentation for list items at the same level
This results in having to check across hundreds of lines making it hard to find the culprit lines.
Requested Feature
Print the list indentation count of spaces of each line referenced in the output.
Workaround
I've just rustled up a couple Bash scripts to allow me to find the offending lists.
This script prefixed the indentation levels of the list lines reported by MDL:
https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/markdown/mdl_list_indentations.sh
But they all showed a multiple of 2 indentations as expected, so I quickly wrote this:
https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/markdown/markdown_list_indentations.sh
which shows the count of spaces on every list line, which showed that the lines causing this error weren't the ones listed bymdl
but rather further up the page in the index section which was generated using another script:
https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/markdown/markdown_generate_index.sh
which had been overridden to generate the index with 3 space indentation instead of 2 space indexation like the rest of the page was using.