[GH-ISSUE #330] Add fixInfo for MD022 #285

Closed
opened 2026-03-03 01:25:24 +03:00 by kerem · 9 comments
Owner

Originally created by @nschonni on GitHub (Sep 19, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/330

It seems like this one should be "fixable". Not sure if you already looked at it and ruled it out because of some edge cases

Originally created by @nschonni on GitHub (Sep 19, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/330 It seems like this one should be "fixable". Not sure if you already looked at it and ruled it out because of some edge cases
kerem 2026-03-03 01:25:24 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Sep 19, 2020):

MD022 should include fix info for all scenarios it flags as an error: https://github.com/DavidAnson/markdownlint/blob/main/lib/md022.js

Is that not working or did you mean a different rule?

<!-- gh-comment-id:695368816 --> @DavidAnson commented on GitHub (Sep 19, 2020): MD022 should include fix info for all scenarios it flags as an error: https://github.com/DavidAnson/markdownlint/blob/main/lib/md022.js Is that not working or did you mean a different rule?
Author
Owner

@nschonni commented on GitHub (Sep 20, 2020):

Sorry, I think i'm actually hitting a small bug between cli and cli2.
I was running it against dotnet/docs to try out the fix for that one. cli returns 5K+ changed files, and CLI2 returned ~4K files.
I was getting mixed up because CLI2 was returning errors into the console in addition to some fixed files

<!-- gh-comment-id:695369345 --> @nschonni commented on GitHub (Sep 20, 2020): Sorry, I think i'm actually hitting a small bug between cli and cli2. I was running it against dotnet/docs to try out the fix for that one. cli returns 5K+ changed files, and CLI2 returned ~4K files. I was getting mixed up because CLI2 was returning errors into the console in addition to some fixed files
Author
Owner

@DavidAnson commented on GitHub (Sep 20, 2020):

Can you describe the difference or give an example or the commands to reproduce this?

<!-- gh-comment-id:695632760 --> @DavidAnson commented on GitHub (Sep 20, 2020): Can you describe the difference or give an example or the commands to reproduce this?
Author
Owner

@nschonni commented on GitHub (Sep 20, 2020):

Sure, here is the steps:

  1. Clone dotnet/docs
  2. Remove MD022 suppression in .markdownlint.json
  3. Run markdownlint "**/*.md" --fix
  4. 5K+ files updated, no warnings in console
  5. Reset changes, and reapply .markdownlint.json MD022 supression
  6. Run markdownlint-cli2 "**/*.md" --fix
  7. 4K< files changed, and console warnings for MD022 issues printed
<!-- gh-comment-id:695638546 --> @nschonni commented on GitHub (Sep 20, 2020): Sure, here is the steps: 1. Clone dotnet/docs 2. Remove MD022 suppression in `.markdownlint.json` 3. Run `markdownlint "**/*.md" --fix` 4. 5K+ files updated, no warnings in console 5. Reset changes, and reapply `.markdownlint.json` MD022 supression 6. Run `markdownlint-cli2 "**/*.md" --fix` 7. 4K< files changed, and console warnings for MD022 issues printed
Author
Owner

@DavidAnson commented on GitHub (Sep 20, 2020):

At the risk of nitpicking, "--fix" is not a command line argument for CLI2; I assume you are setting fix:true in its options file? I can try this and have a look.

<!-- gh-comment-id:695746127 --> @DavidAnson commented on GitHub (Sep 20, 2020): At the risk of nitpicking, "--fix" is not a command line argument for CLI2; I assume you are setting `fix:true` in its options file? I can try this and have a look.
Author
Owner

@nschonni commented on GitHub (Sep 20, 2020):

Nope, was just using the old config format. Not sure why CLI2 was updating the files then :P

<!-- gh-comment-id:695747120 --> @nschonni commented on GitHub (Sep 20, 2020): Nope, was just using the old config format. Not sure why CLI2 was updating the files then :P
Author
Owner

@DavidAnson commented on GitHub (Sep 20, 2020):

I've never seen files get updated without fix:true. If that's happening, please let me know how. The --fix argument should only seem like another file glob.

<!-- gh-comment-id:695747871 --> @DavidAnson commented on GitHub (Sep 20, 2020): I've never seen files get updated without `fix:true`. If that's happening, please let me know how. The `--fix` argument should only seem like another file glob.
Author
Owner

@nschonni commented on GitHub (Sep 20, 2020):

I'll take a look tomorrow again when I'm on my other machine. Feel free to flip this issue over to the cli2 repo though, since it's not really related to the core lib anymore

<!-- gh-comment-id:695747970 --> @nschonni commented on GitHub (Sep 20, 2020): I'll take a look tomorrow again when I'm on my other machine. Feel free to flip this issue over to the cli2 repo though, since it's not really related to the core lib anymore
Author
Owner

@nschonni commented on GitHub (Sep 20, 2020):

You're right, I must have not reset the changes fully. I'll stick with the original CLI for the fixes since the config way is a little annoying when trying out fixes

<!-- gh-comment-id:695807633 --> @nschonni commented on GitHub (Sep 20, 2020): You're right, I must have not reset the changes fully. I'll stick with the original CLI for the fixes since the config way is a little annoying when trying out fixes
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#285
No description provided.