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

VAR_INVALID_NAME false positive with number-suffixed names #532

Closed
timbeadle opened this issue Jan 8, 2018 · 5 comments
Closed

VAR_INVALID_NAME false positive with number-suffixed names #532

timbeadle opened this issue Jan 8, 2018 · 5 comments
Milestone

Comments

@timbeadle
Copy link

if (urlScope.keyExists('id2') && isNumeric(urlScope.id2)) {
	route &= '/:id2';
}

[INFO]: [cflint] VAR_INVALID_NAME: Variable id2 is not a valid name. Please use camelCase or underscores.

Using CFLint v1.3.0.

@ryaneberly
Copy link
Contributor

Does :id2 dereference id2 automatically?

@KamasamaK
Copy link
Collaborator

That is just concatenating a string literal, but that would be beside the point. The issue is simply that variable names like the example above or address1 are triggering the *_INVALID_NAME rules.

@ryaneberly
Copy link
Contributor

ryaneberly commented Jan 9, 2018

Thanks @KamasamaK , I agree, i was just curios, since that code will also trigger a var unused message.

ryaneberly added a commit that referenced this issue Jan 9, 2018
@ryaneberly
Copy link
Contributor

ryaneberly commented Jan 9, 2018

This has been a 'feature' almost since the beginning. I had to disable or change almost a dozen tests after I fixed this one. :) However, I agree that ending a number should not be considered invalid naming.

ryaneberly added a commit that referenced this issue Jan 9, 2018
@ryaneberly ryaneberly added this to the 1.4.0 milestone Jan 9, 2018
@timbeadle
Copy link
Author

Thanks @ryaneberly for the quick turnaround 😄

ryaneberly added a commit that referenced this issue Sep 27, 2018
remove accidental add of cflint-result.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants