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 VAR_ALL_CAPS for components #239

Closed
bardware opened this issue Feb 15, 2017 · 7 comments
Closed

Ignore VAR_ALL_CAPS for components #239

bardware opened this issue Feb 15, 2017 · 7 comments

Comments

@bardware
Copy link

Hi,

I have a component that defined constant values I use all over my software; it looks like

<cfcomponent>
    <cfset this.ROOMRESERVATIONS.SINGLE = 1>
    <cfset this.ROOMRESERVATIONS.DOUBLE = 2>

    <cfset this.YES = 1>
    <cfset this.NO = 2>
<cfcomponent>

No that you introduced a syntax to ignore checks on component level, I'd love a way to ignore VAR_ALL_CAPS on component level.

@ryaneberly
Copy link
Contributor

ryaneberly commented Feb 16, 2017 via email

@bardware
Copy link
Author

Exactly, yes!

@mpaluchowski
Copy link
Contributor

Agree. And not just for the this scope, but also for variables and script syntax :)

component {
  this.SOMECONSTANT = 1;
  SOMEOTHERCONSTANT = 2;
}

@ryaneberly
Copy link
Contributor

I think that means you want to control the message by scope. Sounds good to me.

ryaneberly added a commit that referenced this issue Mar 4, 2017
@ryaneberly
Copy link
Contributor

I added this parameter to VariableNameChecker in cflint.definition.json:
{
"name": "IgnoreAllCapsInScopes",
"value": "this"
}

I suggest we make it ignore ALLCAPS in the 'this' scope by default. What do you think?

@mpaluchowski
Copy link
Contributor

I suggest we make it ignore ALLCAPS in the 'this' scope by default. What do you think?

I would ignore both in this as well as variables. We sometimes use the format to emulate an Enum, where we use this, and sometimes to emulate constants, which usually use variables, unless they should be exposed outside of the class, in which case they use this.

ryaneberly added a commit that referenced this issue Mar 4, 2017
ryaneberly added a commit that referenced this issue Mar 4, 2017
@ryaneberly
Copy link
Contributor

ryaneberly commented Mar 4, 2017 via email

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

No branches or pull requests

3 participants