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

deny list based filtering #5

Closed
dvdsk opened this issue Jul 21, 2021 · 1 comment
Closed

deny list based filtering #5

dvdsk opened this issue Jul 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@dvdsk
Copy link
Owner

dvdsk commented Jul 21, 2021

Text to be checked/linted is added to a lintreq. To determine whether text should be linted I check if it corresponds to an allowed highlight group using tree-sitter queries, a allow list based system:

For any tree-sitter subtree (parser:for_each_tree)
     iter over highlights (hl_query:iter_captures)
         add to lintreq if allowed hl_group

Some languages, such as latex, need text linted that is not highlighted. For this we need a deny list style operation.

change

Configuration must be language dependent
Instead of always running in allow list mode the event handler on_event should change to deny list mode depending on config

language dependent config

options:

  • switch based on parser lang
  • switch based on buffer lang (an autocommand?)
  • switch based on file extension (see 25ec193)

deny list style on_event

split lintreq builder into allow builder and deny builder. Both still build into a lintreq

@dvdsk dvdsk added the enhancement New feature or request label Jul 21, 2021
@dvdsk dvdsk changed the title Blacklist based filtering deny list based filtering Jul 21, 2021
@dvdsk
Copy link
Owner Author

dvdsk commented Aug 9, 2021

replaced with treesitter query based linting doing away with hl groups entirely

@dvdsk dvdsk closed this as completed Aug 9, 2021
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

1 participant