Why is this an issue?

Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule allows to check that all variables names match a provided regular expression.

This rule does not check namespace variable names. See Namespace variable names should comply with a naming convention instead.

How to fix it

Code examples

Noncompliant code example

With default regular expression ^[a-z]|[a-z]+[a-z0-9_]*[a-z0-9]+$:

set Fly 42

Compliant solution

With default regular expression ^[a-z]|[a-z]+[a-z0-9_]*[a-z0-9]+$:

set fly 42

Known limitations

The rule is not checked if the name of the variable is dynamic:
set $fly 42

Resources

Related rules