Skip to content
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

Ignore mechanism not working properly #489

Closed
rcastagno opened this issue Nov 29, 2017 · 1 comment
Closed

Ignore mechanism not working properly #489

rcastagno opened this issue Nov 29, 2017 · 1 comment
Labels
Milestone

Comments

@rcastagno
Copy link
Contributor

rcastagno commented Nov 29, 2017

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?

@ryaneberly ryaneberly added this to the 1.3.0 milestone Dec 19, 2017
@ryaneberly ryaneberly added the bug label Dec 19, 2017
ryaneberly added a commit that referenced this issue Dec 19, 2017
@ryaneberly
Copy link
Contributor

@rcastagno, Good catch. I've been hearing some complaints that the ignore mech isn't working well. The EOL comment form was not working in mixed tag and script code. Your example is fixed in dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants