Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek committed Jun 19, 2023
1 parent edccb7c commit 03043bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion credsweeper/rules/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, config: Config, rule_dict: Dict) -> None:
required_regex = rule_dict.get(Rule.REQUIRED_REGEX)
if required_regex and not isinstance(required_regex, str):
self._malformed_rule_error(rule_dict, Rule.REQUIRED_REGEX)
self.__required_regex = regex.compile(required_regex) if required_regex else None
self.__required_regex = re.compile(required_regex) if required_regex else None
self.__min_line_len = int(rule_dict.get(Rule.MIN_LINE_LEN, MAX_LINE_LENGTH))
self.__usage_list: List[str] = rule_dict.get(Rule.USAGE_LIST, [])

Expand Down
2 changes: 1 addition & 1 deletion credsweeper/scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def scan(self, targets: List[AnalysisTarget]) -> List[Candidate]:
# use lower case for required substring
target_line_stripped_lower = target_line_stripped.lower()
# cached value to skip the same regex verifying
matched_regex: Dict[regex.Pattern, bool] = {}
matched_regex: Dict[re.Pattern, bool] = {}

for rule, scanner in [ #
(rule, scanner) for (rule, scanner) in self.rules_scanners \
Expand Down

0 comments on commit 03043bd

Please sign in to comment.