Closed localjo closed 8 years ago
The added benefit of giving each threshold a different ruleId
would be that the messages could be turned off/on or given a different error/warning level based on which threshold they hit.
To be consistent with the way things work currently, here's another potential target:
7:1-7:265 warning Hard to read sentence, Threshold 6/7 hard-to-read-6
8:1-8:165 warning Hard to read sentence, Threshold 5/7 hard-to-read-5
9:1-9:65 warning Hard to read sentence, Threshold 4/7 hard-to-read-4
OK, thinking out loud here, these are my initial feels:
error
s is that they cause everything to stop: no further plugins are run, no further messages are triggered for that file. Still, I am OK with adding an option to set a threshold which, when messages above that threshold are found, stops processing.<!--some-name ignore hard-to-read-4-->
to turn off -5
, -6
, and -7
as well? Itβs much easier to have <!--some-name ignore hard-to-read-->
turn off the next paragraph.I also think that your initial issues sort-of poses an XY-problem: the messages are unclear, but instead of just changing the messages, you propose adding a ruleId
, which will make it possible to write code which does that. I think changing the messages / adding sureness
accomplishes this as well!?
Makes sense. Especially about the ruleId
. I didn't think about the message-control scenario. Maybe we can just add one ruleId
for all of them? retext-readability
or just readability
?
For the errors, I'm just thinking it would be nice to have different severity levels for the messages, not that it would be a thread-stopping error. I've currently got a workaround in quality-docs
that does this, and it works nicely. But that's probably an extensive change across lots of plugins and really it's a different issue anyway.
I'm wrapping up for the day, but I think tomorrow I'll create a PR that does the following;
ruleId
of retext-readability
to readability messagesHow's that sound?
Good!
source
, seems logical for plugins with just one rule (PS ruleId
can be passed as a third argument to warn()
)And related to severities: https://github.com/wooorm/remark-lint/issues/65.
I had a hard time figuring out what the sureness threshold messages meant until I read the code. The possible messages are;
What those really mean is;
To make the messaging more clear, I propose that we add a
ruleId
and improve the wording of the message. Maybe we could target an end result that looks something like this;Open to other suggestions. The "error"/"warning" level is another question altogether, but I put it in my example just to illustrate more how it could be used.