Skip to content

Commit

Permalink
Fix type() usage check in validate-modules.
Browse files Browse the repository at this point in the history
This avoids false positives when 'if' or 'or' are in a string
preceding the use of type() on the same line.
  • Loading branch information
mattclay committed Feb 8, 2017
1 parent 43ae127 commit 46f9648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sanity/validate-modules/validate-modules
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ from voluptuous.humanize import humanize_error

BLACKLIST_DIRS = frozenset(('.git', 'test', '.github', '.idea'))
INDENT_REGEX = re.compile(r'([\t]*)')
TYPE_REGEX = re.compile(r'.*(if|or)(\s+.*|\s+)(?<!_)(?<!str\()type\(.*')
TYPE_REGEX = re.compile(r'.*(if|or)(\s+[^"\']*|\s+)(?<!_)(?<!str\()type\(.*')
BLACKLIST_IMPORTS = {
'requests': {
'new_only': True,
Expand Down

0 comments on commit 46f9648

Please sign in to comment.