Skip to content

Ignore mechanism not working properly #489

@rcastagno

Description

@rcastagno

I'm trying to ignore some issues, but unable to get it quite right

<cfcomponent>
    <cffunction name="init">
      <cfscript>
          my = structnew(); // cflint ignore:MISSING_VAR
          my.somekey = "";
      </cfscript>
    </cffunction>
</cfcomponent>

this results in

Message code:MISSING_VAR
        File:C:\progetti\tesisquare\cflint_src\CFLint\tesitest\4\cflintTest3.cfc
        Column:3
        Line:4
                Message:Variable my is not declared with a var statement.
                Variable:'my' in function: init
                Expression:my

but if I remove the my.somekey = ""; line, it will correctly report 0 errors.

The CFML comment annotation seems to be working properly:

<cfcomponent displayname="cflintTest">
    <cffunction name="init" output="false">
        <!--- @CFLintIgnore MISSING_VAR --->
        <cfset my = structnew()>
    </cffunction>
</cfcomponent>

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions