Comments (4)
I'm not sure how I feel about not having a numeric ID for rules, but the two arguments I have in favor of them (easier to type and refer to in chat/IM/issues, and no need to change the ID later if the name doesn't make sense any more, such as if I'd named MD007 'multimarkdown_list_indent' before discovering another reason for wanting 4 space indents) aren't that strong. The inspiration for this way of doing things btw is Foodcritic rather than rubocop. It's interesting to see the different choices made between the two.
I do really like the idea of having rules be able to take parameters in style files, and it does neatly solve the issue of multiple rules that do essentially the same thing as well as conflicts.
from markdownlint.
Parameters are done and in a branch. They'll be merged once I clean up the rules to use them.
However, regarding rule names, I think I'm still going to come down on the side of
having a short, mostly numeric, identifier for all rules. I've thought about
it quite a bit and there are two other issues I came across while trying out
named rules:
- Some of the later rules will end up with rule names almost as long as the
descriptions in order to fully specify what they do (e.g. multiple spaces
inside hash on atx_closed headers), and while parameters have helped with some
of those (the header style rule description is much more concise), it won't
help everywhere. - Remembering the name of the rule without looking it up is more difficult than
remembering a shorter number (e.g. was the rule name
header_trailing_blank_line, header_surround_blank_lines or something else).
Both of these could be solved with aliases, but that sacrifices
recognizability of a given rule, especially if more terse forms are used, and
you're right back to the original issue that prompted having.
Ultimately, the tradeoff is reading and recognizing (in style files or other
places where it won't have the description printed next to the ID) vs writing
and remembering.
from markdownlint.
I understand the difficulty, and of course the final decision is up to you.
I believe:
- When writing the config file: both numbers and meaningful names are hard enough to remember that people writing the config file will have to look up the docs in both cases for a very long time before they are confident enough with them to write the config without checking.
- When reading:
- for readable IDs, you might have to look a few times at the docs, but it is likely that you will soon be able to guess correctly what they mean.
- for numbers, readers will have to look at the docs for way longer before they memorize what they mean. They could always add comments to the config file, but then why not use the comment strings as data instead of the IDs?
People will read the files much more than they write them, since every contributor has to read it to know what style to use, but only a few owners will modify the file occasionally.
from markdownlint.
The rule parameters option has been merged. As part of this, I updated the style files to not have to exclude the rules that have now been removed. As part of this, I simplified the ************ style file significantly. Let me know if the changes make sense or not.
For now I'm closing this issue. Docs on creating style files/rules/parameters I'll add as a separate issue.
from markdownlint.
Related Issues (20)
- Please place a new tag version HOT 14
- Bogus error MD057 for inline `A|B` HOT 6
- MD053 false positive for links in admonitions (MkDocs) HOT 2
- Using --config with invalid path doesn't throw an error
- MD029 Ordered list item prefix is error and bug HOT 4
- Wrong mdl version on latest Docker image
- Unable to store '.markdownlint.json' in any other location than root HOT 2
- Fully release v0.13.0
- Please publish release > v0.13.0
- MD024: property allow_different_nesting is not allowed HOT 2
- MD022: add `num_empty_lines_above` and `num_empty_lines_below` parameter
- Publish arm docker image
- [MD041] Error with metadata HOT 2
- Enhance rule MD033 to be more specific HOT 1
- Remove trailing slashes from filename directory argument
- extra newlines after front matter introduce off-by-one error in line numbers with `--ignore-front-matter`
- MD056 - Consistent column number check not taking into account escaped pipes
- "Extra documentation for rule..." printed when no URL is available
- --filenames-only option
- [MD022] consecutive increasing headers should not need to be separated by blank lines HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdownlint.