markdownlint icon indicating copy to clipboard operation
markdownlint copied to clipboard

MD007 when MD010 disabled

Open Malix-Labs opened this issue 2 years ago • 5 comments

Fix

Subject

MD007 when MD010 disabled

Object

When MD010 is disabled (hard tabs use case), it should be:

  • MD007.indent = 1 and MD007.start_indent = 1 by default
  • Formatting to tabs instead of spaces

Malix-Labs avatar Oct 17 '23 18:10 Malix-Labs

Just because tabs are allowed in a project does not mean they will/should be used for lists. Although I think that could be specified via a parameter to the rule.

DavidAnson avatar Oct 17 '23 18:10 DavidAnson

  • Comment Reply from @DavidAnson:

    because tabs are allowed in a project does not mean they will/should be used for lists

    Disagree It's a convention to normalize the indentation style project-wise If MD010 is disabled, it means that the project is enforcing a tab style indentation Tab style indentation => 1 tab / indentation

Malix-Labs avatar Oct 17 '23 18:10 Malix-Labs

With very few exceptions, rules do not change their behavior based on how other rules are configured. This project prefers spaces and provides rule MD010 to help enforce that. Disabling MD010 does not introduce a requirement to use tabs. As the specification outlines, the behavior of tab stops is not always intuitive (https://spec.commonmark.org/0.30/#tabs).

It sounds like adding the parameter I propose above would satisfy your scenario.

DavidAnson avatar Oct 17 '23 19:10 DavidAnson

  • Comment Reply from @DavidAnson:

    Disabling MD010 does not introduce a requirement to use tabs

    Do you mean that disabling MD010 does remove the requirement to not use hard tabs, rather that induce the requirement to use tabs?

  • Comment Reply from @DavidAnson:

    It sounds like adding the parameter I propose above would satisfy your scenario.

    If previous point is true, then agreed

Malix-Labs avatar Oct 17 '23 19:10 Malix-Labs

Correct: MD010 will warn about tabs when it is enabled, but will do nothing when it is disabled.

DavidAnson avatar Oct 18 '23 00:10 DavidAnson