Check / Assert¶
More than detecting the naming convention of an identifier you can check it's the one you expect.
Python¶
You can detect which naming convention is used with:
>>> from nomage import naming
>>> id_naming = naming("my-identifier")
>>> id_naming.convention == "kebab"
True
Of course wrong returns False.
>>> from nomage import naming
>>> id_naming = naming("my-identifier")
>>> id_naming.convention == "snake"
False
CLI¶
Check it from a terminal:
Check will fail with a return code not equal to 0.