mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #1039] New Table formatting rule #598
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#598
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gabriel-check24 on GitHub (Nov 13, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1039
I'd like to contribute a table formatting rule. The code I currently have will fix #90, #93, #132.
I'm creating this issue to both collect all table related issues (#92, #323) in one place and to secure a rule number.
Can I use Number 55?
rules.jscontains// md055: See https://github.com/markdownlint/markdownlintI haven't found an issue mentioning MD055 though.
@DavidAnson commented on GitHub (Nov 13, 2023):
The Ruby implementation added three rules for tables recently and what you see are the placeholders I added. You can read more at the bottom here: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md. They immediately got issues which have not been addressed as far as I know.
What you propose here is likely to be a very big undertaking. Someone else recently added a rule and I spent about a week reviewing and two weeks polishing, so anything here isn't going to make the current release.
Please read the contributing guidelines first so you know what's expected. For things that rely on a parser, please use the micromark tokens as that's the new direction. Adhere to the GFM standard for table syntax. I'll warn you that I will be very picky on the review.
One consideration is whether this should be one overall rule or multiple individual rules. Historically, specific individual rules has been the practice. If you are implementing an identical rule, please use the same name and number. Otherwise, please take the next consecutive number.
I'll want very good test coverage to try to avoid surprises. I anticipate a lot of edge cases here.
@gabriel-check24 commented on GitHub (Nov 14, 2023):
Thanks for the info, I did not realize this linked to the ruby implementation.
Could you please add MD055, MD056 and MD057 to the respective issue title? This would make searching for them easier.
I think MD55 corresponds to #93 and MD056 to #92.
My work so far was based on the GFM standard, so I should be able to reuse that.
I wasn't sure whether to make individual rules or one for table formatting, but that clears it up,
I'll split into MD055, MD056 and make #132 MD058 then.
Understandable, please do address any issues, I'll run my code against our codebase, too.
Some edge cases are already filtered out by the parser, anything not recognized as a table won't make it to the rule. For the rest, I'll try to add extensive tests.
@DavidAnson commented on GitHub (Nov 14, 2023):
I'll update the issue titles later today. But wanted to emphasize the last thing you said which is that sticking to scenarios the parser recognizes will make things much easier. Rules that try to infer intent outside of what parses successfully tend to be very tricky to get right.
@DavidAnson commented on GitHub (Jan 8, 2024):
MD055 (and MD056) are in library version v0.33.0.