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 namespace names match a provided regular expression.

How to fix it

Code examples

Noncompliant code example

With default regular expression ^[A-Z]|[A-Z]+[A-Za-z0-9]*[A-Za-z0-9]+$:

namespace eval foo { ; # Noncompliant
   ...
   namespace eval bar { ; # Noncompliant
      ...
   }
}

Compliant solution

With default regular expression ^[A-Z]|[A-Z]+[A-Za-z0-9]*[A-Za-z0-9]+$:

namespace eval Foo {
   ...
   namespace eval Bar {
      ...
   }
}

Known limitations

The rule is not checked if the name of the namespace is dynamic:

namespace eval $my_variable {
  ...
}