-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression table-cell-padding
from 9.1.2 to 10.0.0 when evaluating header alignment
#317
Comments
Related error run: https://github.com/crim-ca/weaver/actions/runs/8625660678/job/23642604164 |
Corresponding issue created in https://youtrack.jetbrains.com/issue/PY-71886 |
Relates to #217 |
Hey Francis! I don’t really understand, I think this is not a regression, but a feature.
It seems your issue is more with JetBrains formatting tables in a different way: personally I haven’t seen that style often. If you use a formatter, then you don’t need this rule, right? So turning it off doesn’t matter? |
In a way, the And as shown by the lines https://github.com/standard/standard/blob/3b3c316a358ad8d306229a59a67c92891e0827f3/README.md?plain=1#L177-L181, the leading |
This is a stretch to me. They’re very much cells to me. They work like cells. Just, they contain dashes and colons. So I do think the feature is doing exactly what advertised.
Why do you think that whether cells are aligned, relates to whether cells are padded, in that way? I see an inconsistent table there: sometimes padded, sometimes not. Importantly, the OP 217, mentions what should and should not be valid. And that such a rule would be useful to standard.
This is terrible. A really bad style. If this proves anything, it’s that that table is not to be looked at for inspiration of any kind.
Huh? I don’t understand how the sentence before can lead you to conclude this?
If you want your own kind of tables, indeed, turn it off. You can make your own rules to match your own styles. |
If they were, they would be rendered as cells, but they are not. They are the line between the header and the other cells, plus have special meaning about the following cell's content alignment. They are very different from any other "normal" cell.
When cells are not aligned, adding the extra padding is not that important, since it is not expected that they would line up. So the minimal
My point about this was that, due to the limitation of
It don't think it is only a matter of "my own style". There are plenty of examples out there that use the proposed format. |
I really very strongly disagree here.
The minimal “filler” is
How is this rule causing that?
Users are always fighting against linters. Any new lint is annoying at first. That’s my experience with other linters. And then after a bit I get it. This one doesn’t show for me what you say it does. You’re the first person who disagrees with this style in 13 years, since I started with markdown. Our tools formatting markdown are more popular: https://github.com/wooorm/markdown-table is just the tables part. Which remark uses internally. |
This is why I marked this issue as a "regression". It was not doing this before, but now it does. It is not a new thing "happening at first", it is something that was allowed for a very long time, and suddenly started triggered on every repo that use this format. And this, causes a lot of noise.
It uses the
Since it was silently allowed before, it is not surprising if nobody raised concerns about it... I'm not against or for any particular style, but rather, in the camp of "consistent across the repository". As long as the rule is applied the same way everywhere, I think this format variant is just as valid as the fully-padded or fully-compact one, particularly since we can find many examples online using it. Regrettably, it seems the only option I have now is to disable the rule entirely, which then can lead to such inconsistencies. I would much rather have the option to explicitly check the format than ignoring it. |
This comment has been minimized.
This comment has been minimized.
… + combine npm configs into a single location
Initial checklist
Affected packages and versions
remark-lint-table-cell-padding
Link to runnable example
No response
Steps to reproduce
Run
make check-md
using https://github.com/crim-ca/weaver.This should trigger an error on this table: https://github.com/crim-ca/weaver/blob/73fe9a5a1c56047c73648f30e084961777ab806a/SECURITY.md?plain=1#L11-L14
Alternatively, install the packages yourself (https://github.com/crim-ca/weaver/blob/73fe9a5a1c56047c73648f30e084961777ab806a/Makefile#L287-L299), and run the remark-lint command (https://github.com/crim-ca/weaver/blob/73fe9a5a1c56047c73648f30e084961777ab806a/Makefile#L616-L623).
Expected behavior
A table using no spaces between
-
used to separate the header was permitted.The
table-cell-padding
rule was actually applied to cells, not the header alignment definition.For example, the following did not raise any error (as expected).
While the following did raise it:
While I can understand wanting to favor
| --- |
instead of|---|
to align with examples such as https://www.markdownguide.org/extended-syntax/#tables, there is no more any way to support the desired format. Settingpadded
forces adding extra spaces,consistent
raises that they are not, andcompact
forces removing the spaces in the cells, making it less readable. There should be an option to allow controlling the header alignment padding separately from cells.The motivation of this is that some IDEs, notably JetBrains, support auto-formating tables. When it does, it uses the formatting method of the first example, which is valid Markdown. With version 10.0.0, one as to completely disable
table-cell-padding
due to this limitation, which can lead to the introduction of miss-padded cells.Actual behavior
The table
Leads to (using
padded
):Leads to (using
compact
):Leads to (using
consistent
):Runtime
Node v16
Package manager
npm 8
OS
Linux
Build and bundle tools
Other (please specify in steps to reproduce)
The text was updated successfully, but these errors were encountered: