You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to generate "possible" lints with relint, and then use other CLI tools to determine whether each lint is a false positive or not.
Specifically, my use-case is to find instances of \bTODO #\d+ and check whether the #\d+ refers to an open ticket. This requires checking the status of tickets in a ticket-tracker, which is well outside the purview of relint. But if relint had a way to feed a particular lint to a downstream program, especially using regex captures, this would be pretty simple:
- name: TODOS with ticketspattern: '\bTODO #(\d+)'hint: make sure that the ticket is openerror: falsefilePattern: '^(?!docs/)'postprocess: "glab issue show '${1}' | grep '^state:' | grep -q open"
Here, a status code of 1 means that the lint IS valid, and 0 means it's a false positive. (I'm not sure whether there's a better way to do this than using status codes, and it's not obvious whether 0 should mean "valid" or "false positive", but I think those are primarily documentation issues.)
The text was updated successfully, but these errors were encountered:
Bonus: if test_func is used in combination with pattern, it should only operate on regex matches instead of on the entire file. This would make it the equivalent of the postprocess proposed above, but would make for a better integration than CLI exit codes (assuming that some kind of Python interface would exist in order to integrate the test_funcs with reLint).
Note: from Python, we could then pretty easily integrate with CLI tools if necessary.
I'd like to be able to generate "possible" lints with
relint
, and then use other CLI tools to determine whether each lint is a false positive or not.Specifically, my use-case is to find instances of
\bTODO #\d+
and check whether the#\d+
refers to an open ticket. This requires checking the status of tickets in a ticket-tracker, which is well outside the purview ofrelint
. But ifrelint
had a way to feed a particular lint to a downstream program, especially using regex captures, this would be pretty simple:Here, a status code of
1
means that the lint IS valid, and0
means it's a false positive. (I'm not sure whether there's a better way to do this than using status codes, and it's not obvious whether0
should mean "valid" or "false positive", but I think those are primarily documentation issues.)The text was updated successfully, but these errors were encountered: