Skip to content

Commit

Permalink
🐍 Remove unused filename_key argument
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinHock committed Mar 30, 2020
1 parent 00b9bf8 commit 7c32918
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions detect_secrets/core/secrets_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,28 +210,21 @@ def scan_diff(
),
)

def scan_file(self, filename, filename_key=None):
def scan_file(self, filename):
"""Scans a specified file, and adds information to self.data
:type filename: str
:param filename: full path to file to scan.
:type filename_key: str
:param filename_key: key to store in self.data
:returns: boolean; though this value is only used for testing
"""

if not filename_key:
filename_key = filename

if os.path.islink(filename):
return False
if os.path.splitext(filename)[1] in IGNORED_FILE_EXTENSIONS:
return False
try:
with codecs.open(filename, encoding='utf-8') as f:
self._extract_secrets_from_file(f, filename_key)
self._extract_secrets_from_file(f, filename)

return True
except IOError:
Expand Down

0 comments on commit 7c32918

Please sign in to comment.