Skip to content
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

Ignore Specific Instances of a Finding #48

Open
celestialorb opened this issue Aug 26, 2023 · 0 comments
Open

Ignore Specific Instances of a Finding #48

celestialorb opened this issue Aug 26, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@celestialorb
Copy link

celestialorb commented Aug 26, 2023

Is your feature request related to a problem? Please describe.
I'd like to be able to instruct gramma to ignore a specific finding. I'm using Markdown with Pandoc and have some control sequences like \newpage which gets picked up as an issue by gramma/LanguageTool. These cases make using gramma difficult because on each run I have to tell it to ignore each and every one every time, or separate out files with these types of sequences.

Describe the solution you'd like
I'd like to be able to instruct gramma to ignore specific findings by line (similar to most linters). I can see a few ways of accomplishing this.

The first would be to append a Markdown comment to the end of a line to instruct gramma to throw away the finding from the LanguageTool server:

\newpage <!-- gramma:ignore -->

Another method could be to surround a block of text to control whether or not gramma returns findings, similar to Python's Black formatter.

<!-- gramma:off -->
\newpage
<!-- gramma:on -->

Not sure how this would be accomplished outside of Markdown as the concept of a comment may not work everywhere else this is used.

For my specific case, perhaps a flag for LaTeX could be implemented (--latex); similar to the --markdown flag to remove these false positives.

Could also take an approach similar to the VSCode LanguageTool extension and save a database of manually marked false positives as I've done for this case:

{"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\Q\\newpage\\E$"}

Describe alternatives you've considered
I can't think of any alternatives.

@celestialorb celestialorb added the enhancement New feature or request label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants