|
|
@ -10,6 +10,7 @@ class NamingConvention(AbstractDetector): |
|
|
|
Exceptions: |
|
|
|
Exceptions: |
|
|
|
- Allow constant variables name/symbol/decimals to be lowercase (ERC20) |
|
|
|
- Allow constant variables name/symbol/decimals to be lowercase (ERC20) |
|
|
|
- Allow '_' at the beggining of the mixed_case match for private variables and unused parameters |
|
|
|
- Allow '_' at the beggining of the mixed_case match for private variables and unused parameters |
|
|
|
|
|
|
|
- Ignore echidna properties (functions with names starting 'echidna_' or 'crytic_' |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
ARGUMENT = 'naming-convention' |
|
|
|
ARGUMENT = 'naming-convention' |
|
|
@ -97,6 +98,8 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
if not self.is_mixed_case(func.name): |
|
|
|
if not self.is_mixed_case(func.name): |
|
|
|
if func.visibility in ['internal', 'private'] and self.is_mixed_case_with_underscore(func.name): |
|
|
|
if func.visibility in ['internal', 'private'] and self.is_mixed_case_with_underscore(func.name): |
|
|
|
continue |
|
|
|
continue |
|
|
|
|
|
|
|
if func.name.startswith("echidna_") or func.name.startswith("crytic_"): |
|
|
|
|
|
|
|
continue |
|
|
|
info = "Function '{}' ({}) is not in mixedCase\n" |
|
|
|
info = "Function '{}' ({}) is not in mixedCase\n" |
|
|
|
info = info.format(func.canonical_name, func.source_mapping_str) |
|
|
|
info = info.format(func.canonical_name, func.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|