-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support a way to ignore found issues in the future. #195
Comments
I know how an empty log file in the search for errors feels but I believe it's deceptive to disable checks. |
Sure, I could build all sorts of solutions on top of the cflint output and manually filtering out results I don't want. But having a way to annotate parts of ones code with instructions to not check and apply certain rules is really the norm. The fact that you find it deceptive to disable checks is appreciated, but you wouldn't have to use that feature if you don't like it. The option should be there nevertheless. |
@TheRealAgentK , I hear you. We haven't supported code annotations yet. But you can accomplish some of this with the cflintexclude.json file You can filter out codes by file, function name, and line number. |
Added support for and |
What syntax would you suggest for function annotations? something like: |
Yes, I like that. In Android for instance, it'd be: This syntax would obviously not work in CF, so it'd have to be in a comment as you've shown it. One question: What would the syntax look like if I wanted to suppress multiple lint rules for a function? In Android that'd work via: @SuppressLint({"NewApi","StringFormatInvalid"}), but I find this syntax rather clunky and convoluted Going with your example, I'd like to be able to just use a comma-separated list: @CFLintIgnore MISSING_VAR,SOMETHINGELSE,ANOTHERTHINGTOIGNORE |
I like it. |
Support added at the line level in cfscript: at the component and function level in cfscript:
at the component and function level in CFML:
|
Is there any support for lines in normal tag-based code outside ignoring a whole function or a whole component? To properly explain what I mean: I might have a sequence of CFML tag-based code. In one of the tags, I know there's an issue. So, it'd be good to be able to do:
What the above pseudo code should do is then ignore RULE1,RULE2 in |
Yes @TheRealAgentK , only at the component and function level in CFML:
I think that's working. There's a test here: |
the project is sadly in need of some documentation.... |
Added testcase for #195 (ignoring rules) not working
The current mechanism doesn't seem to work across all rules. In my case I can't get CFQUERYPARAM_REQ to be ignored at all. Added test case demonstrating the issue to dev (c88b366). I'm not sure if there are any other places I could possibly put the @CFLintIgnore annotation :) I noticed that all the test cases were for MISSING_VAR only - is there some dependency on a certain category of rules in the implementation of this? |
…) to how it actually should look like.
…t actually should look like. (#296)
Is this one all set now? |
I think from the reoccured issue of CFQUERYPARAM_REQ point-of-view, yes! |
Let's say I in general want to run the rule that checks for missing default values in non-required function arguments.
But I might have a few custom instances for which I don't want this rule to be applied - maybe because it's been taken care of in the code. So we'd want to exclude a certain function from triggering it.
As far as I can see there's no way to currently do that. Is there any option to implement something like this with Annotations, similarly to how Java linters do offer that (for instance in Android linting). I'd annotate a function so that it ignores a specific rule for future runs.
The text was updated successfully, but these errors were encountered: