Skip to main content

Module naming

Module naming 

Source
Expand description

Naming-convention helpers shared by Solidity lints.

Each check_* returns Some(suggestion) when s violates the convention, None when it already matches. Leading/trailing underscores are preserved.

Functionsยง

check_mixed_case
Some(suggestion) if s is not mixedCase. Pure check โ€” domain exceptions (test-prefixes, allowed patterns, โ€ฆ) live in the lint.
check_pascal_case
Some(suggestion) if s is not PascalCase.
check_screaming_snake_case
Some(suggestion) if s is not SCREAMING_SNAKE_CASE.
emit_rename
Emits lint at span with a machine-applicable rename to expected.
has_acronym_exception
True if s is <pre><pattern><digits><post> for one of the configured acronym patterns (e.g. ERC in rescueERC20Tokens), where pre satisfies pre_is_valid and post is UpperCamelCase. One preserved leading or trailing underscore is tolerated.
preserve_underscores ๐Ÿ”’
suggest ๐Ÿ”’
Single-character names are exempt from every convention.