Skip to content

Commit

Permalink
stripped line
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek committed Jul 18, 2023
1 parent 44d17e9 commit eccc76a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion credsweeper/file_handler/content_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def lines_to_targets(
line_nums = [1 + x for x in lines_range]

for line_pos in lines_range:
if min_len > len(lines[line_pos]):
if min_len > len(lines[line_pos].strip()):
# Ignore target if stripped part is too short for all types
continue
target = AnalysisTarget(line_pos, lines, line_nums, self.descriptor)
yield target
4 changes: 0 additions & 4 deletions credsweeper/scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ def scan(self, provider: ContentProvider) -> List[Candidate]:
# Trim string from outer spaces to make future `x in str` checks faster
target_line_stripped = target.line.strip()
target_line_stripped_len = len(target_line_stripped)
# Ignore target if stripped part is too short for all types
if target_line_stripped_len < self.min_len:
# the target does not satisfy any pattern type of all rules
continue

# "cache" - YAPF and pycharm formatters ...
matched_keyword = \
Expand Down

0 comments on commit eccc76a

Please sign in to comment.