Skip to content

Commit

Permalink
Merge pull request #317 from crytic/special_case_echidna_properties
Browse files Browse the repository at this point in the history
ignore naming convention restriction on echidna_ and crytic_ functions
  • Loading branch information
montyly committed Aug 21, 2019
2 parents b43d4c9 + 5468bc1 commit 9922eb4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions slither/detectors/naming_convention/naming_convention.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class NamingConvention(AbstractDetector):
Exceptions:
- 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
- Ignore echidna properties (functions with names starting 'echidna_' or 'crytic_'
"""

ARGUMENT = 'naming-convention'
Expand Down Expand Up @@ -97,6 +98,8 @@ def _detect(self):
if not self.is_mixed_case(func.name):
if func.visibility in ['internal', 'private'] and self.is_mixed_case_with_underscore(func.name):
continue
if func.name.startswith("echidna_") or func.name.startswith("crytic_"):
continue
info = "Function '{}' ({}) is not in mixedCase\n"
info = info.format(func.canonical_name, func.source_mapping_str)

Expand Down

0 comments on commit 9922eb4

Please sign in to comment.