question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make variable, argument naming etc. configurable

See original GitHub issue

It would be good to be able to configure the various rules around naming/case, e.g.

  • VAR_INVALID_NAME,
  • ARGUMENT_INVALID_NAME,
  • METHOD_INVALID_NAME ,
  • COMPONENT_INVALID_NAME

I would like to specify that (e.g.) variables, arguments and components are PascalCase, while methods are camelCase. This is fairly standard in linters in other languages, e.g. Javascript or SCSS.

(As an aside, the message says “Should be CamelCase or use underscores”, but this should say “Should be camelCase or use underscores” as that’s what currently being asked for.)

Also: configurability on some of the other rules would be good. I would like to specify what constitutes a too wordy, too long or too short variable/argument/method/component name.

e.g.

  • VAR_MIN_LENGTH: 2
  • VAR_MAX_LENGTH: 20

Rulesets could be published as sets of presets, similar to eslint’s presets - AirBnb, Google etc.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ryaneberlycommented, Dec 24, 2017

Fixed. you can configure camel v pascal with the following .cflintrc:

{
   "parameters" : {
       "ComponentNameChecker.case" : "PascalCase"
   }
}

The same applies to most other parameters.

0reactions
ryaneberlycommented, Dec 30, 2017

@TheRealAgentK . It’s automated. java -jar CFLint-xxx.jar -markdown

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoconf - Site Configuration - MIT
Autoconf-generated configure scripts allow your site to provide default values for some configuration values. You do this by creating site- and system-wide ...
Read more >
12.2. Command-Line variable = value Build Variables - SCons
The BoolVariable function takes three arguments: the name of the build variable, the default value of the build variable, and the help string...
Read more >
Using Variables - Ansible Documentation
Simple variables combine a variable name with a single value. You can use this syntax (and the syntax for lists and dictionaries shown...
Read more >
GNU make
GNU make. This file documents the GNU make utility, which determines automatically which pieces of a large program need to be recompiled, ...
Read more >
How to create dynamic configuration files using Ansible ...
For example, you can create an /etc/hosts file containing the current ... Add a placeholder for a variable by providing the variable name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found