CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

Is it possible for dot paths to alert when case doesn't match

Open jevans-gp opened this issue 8 years ago • 5 comments

If i have a CFC in /abc/123/Def/Object.cfc and yet i initialise it as abc.123.def.object that cflint will warn me when casing does not match?

jevans-gp avatar May 09 '17 14:05 jevans-gp

Can you elaborate on that? I'm not sure that I understand the issue.

TheRealAgentK avatar Jun 07 '17 00:06 TheRealAgentK

So we have a coding standard that requires the dot path initialisation to match the file path casing.

so we have a CFC stored in /abc/123/Def/Object.cfc and when i want to initialise that in code, i might do something like: obj = new abc.123.def.object();, however that doesn't match the casing of the file path, so correctly it would be obj = new abc.123.Def.Object();.

jevans-gp avatar Jun 07 '17 10:06 jevans-gp

Ah, I see. The first problem would be to make CFLint know how to bring physical path and package path of a cfc together as you can't assume that everyone has their cfcs in the root directory. I ran into a similar issue when trying to find out the package of a cfc for findbugs reports and @ryaneberly mentioned that'd be a hard one to do.

TheRealAgentK avatar Jun 11 '17 01:06 TheRealAgentK

I checked in a proof of concept that should work for configurations that do not make extensive use of mappings. Take a look at PACKAGE_CASE_MISMATCH

ryaneberly avatar Jun 20 '17 02:06 ryaneberly

Reference ortus config.json as a basis for this

ryaneberly avatar Jun 27 '17 02:06 ryaneberly