CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

Allow exceptions for variable name length tests

Open SebastianZ opened this issue 7 years ago • 3 comments

People may want to generally disallow short variables, though allow one-character variable names like i for indexes.

Therefore there should be a parameter that allows to define a comma separated list of exceptions when checking variable names.

Sebastian

SebastianZ avatar Jan 10 '18 10:01 SebastianZ

Not sure I like the idea of a comma-separated list for exceptions. How do other linters, e.g. for JS handle this?

TheRealAgentK avatar Jan 10 '18 19:01 TheRealAgentK

I'm not aware of any other linters that even have rules related to variable name length. The closest thing I've found to accomplish that is one that allows passing a regular expression to validate names against.

Regarding this request in particular, I'm not really sure about it either.

KamasamaK avatar Jan 10 '18 21:01 KamasamaK

Right or wrong we have the pattern for params with csv. Example from cflint.definition.json:

            {
                "name": "ignoreUpperCaseScopes",
                "value": "CGI,URL"
            },

I would be a fan of moving to a single regex based rule.

ryaneberly avatar Jan 10 '18 23:01 ryaneberly