proselint icon indicating copy to clipboard operation
proselint copied to clipboard

Add support for disabling checks via comments

Open Holzhaus opened this issue 1 year ago • 1 comments

In some cases, there is a false positive or the writer knowingly wants to ignore a failing check in a specific section of the text, but not the entire document.

With this change, checks can be enabled and re-enabled at any time using special comments:

Here, all checks are used.
% proselint: disable
No checks are enabled here.
% proselint: enable
All checks have been reenabled.

It's also possible to disable only some checks:

Here, all checks are used.
% proselint: disable=nonwords.misc,weasel_words.very
Here, the \texttt{nonwords.misc} and \texttt{weasel\_words.very}
checks are disabled.
% proselint: enable=nonwords.misc
At this point, the \texttt{nonwords.misc} check has been reenabled.

This aims to be markup-language agnostic by allowing any printable non-word ASCII character in front of `proselint: instead of maintaining a list of allowed comment styles. Note that there mustn't be any word characters, so toggling checks in the middle of a line is not possible,

Holzhaus avatar Sep 11 '22 13:09 Holzhaus