nvimdev / guard-collection

collection the tools config for guard
MIT License
33 stars 10 forks source link

feat: automate linter exports #11

Closed barrett-ruth closed 1 year ago

barrett-ruth commented 1 year ago

automate linter exports. slightly finnicky solution but should work... may be better functions or ways to accomplish the task.

barrett-ruth commented 1 year ago

@xiaoshihou514 it looks like the clang tidy diagnostic test here failed. This is because you're trying to compare namespace fields of clang-tidy's diagnostic output:

image

with a guard namespace in the code here, instead of the actual diagnostic namespace.

Currently, the namespace has no relevant info to diagnostics and is thus not capture as part of the diagnostic in the clang-tidy linter code.

Solution:

  1. You (or I) could add it to the regex to satisfy the test, even though the field would just be ignored.
  2. I just delete this line in this commit and we're good.
xiaoshihou514 commented 1 year ago

Currently, the namespace has no relevant info to diagnostics and is thus not capture as part of the diagnostic in the clang-tidy linter code.

That's a neovim namespace used to "tag" stuff. clang-tidy uses from_regex which uses diag_fmt so its namespace should be the Guard namespace. Dunno what happened, will investigate further.

barrett-ruth commented 1 year ago

The namespace may not be initialized before the test is run, so the field doesn't show up (nil).

xiaoshihou514 commented 1 year ago

@glepnir 's opinion is just to add an if to guard itself so we don't have to export this. Which does kind of make sensešŸ¤”

Tho I think separating formatter.lua and removing linter exports is as pleasant

xiaoshihou514 commented 1 year ago

The namespace may not be initialized before the test is run, so the field doesn't show up (nil).

Will change that after this batch of pr gets merged.