Open chandler3224 opened 3 years ago
Since you are within a tag context, try the tag-style comment <!--- --->
Ah yes, wasn't the best example. However I used this and still the same
<cfcomponent displayname="test" output="false" hint="test">
<cffunction name="init" access="public" output="false" returntype="test">
<cfset var testA = '' /> <!--- @CFLintIgnore line --->
<cfreturn />
</cffunction>
</cfcomponent>
Used combinations of @CFLintIgnore
and just cflint
. Thanks for the quick reply though.
I write mostly in CFScript and have found that the annotations do not work at all and the rules themselves have a lot of false positives.
/*
@CFLintIgnore MISSING_SEMI,AVOID_USING_CREATEOBJECT,UNUSED_LOCAL_VARIABLE
*/
Yeah, it seems the same with me. The tag comment only works for the whole file as long as it's before a component/function, doesn't support individual lines.
The cfscript comments support seems like it supports some annotations and not others. For example with this mixed snippet:
<cfcomponent displayname="test" output="false" hint="test">
<cffunction name="init" access="public" output="false" returntype="test">
<cfscript>
testB = ''; // cflint ignore:line
</cfscript>
<cfreturn />
</cffunction>
</cfcomponent>
<cfcomponent displayname="test" output="false" hint="test">
<cffunction name="init" access="public" output="false" returntype="test">
<cfscript>
var testB = ''; // cflint ignore:line
</cfscript>
<cfreturn />
</cffunction>
</cfcomponent>
Note the addition of the var
.
Strange one.
I can confirm that (tag-based) annotations have to be the first thing to put in a file, before <cfcomponent ...>, for them to work on the whole file.
Ok, I'm not crazy, I can't get the annotations to work for me, I tried all the variations... doesn't seem to work. I'm in all script, in queryExecute, I tried almost every syntax, and nothing. I'm running with the commandbox cflint command.
The option to use comments to ignore lines/specific rules doesn't seem to be working when running from the command line. I'm running against the following code:
testa
is never ignored. I have tried multiple variations.Environment
Version: 1.5.0 (also tested 1.4.1) Windows 10