Skip to content

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:

nomage my-identifier --check kebab

nomage my-identifier --check kebab

Check will fail with a return code not equal to 0.

nomage my-identifier --check snakeNot matching convention: snake_case / snail_case / pothole_case

nomage my-identifier --check snake