Skip to content

Commit

Permalink
Replace dataclass Mutable Default Values with Call to field
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot[bot] authored Apr 16, 2024
1 parent c122cb1 commit 12c745b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vulnerability_fix_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _read_repository_and_file_names(json_file_name: str) -> 'VulnerableProjectFi
return VulnerableProjectFiles(project_name, files)

def _load_vulnerable_projects(self) -> List['VulnerableProjectFiles']:
vulnerable_projects: List[VulnerableProjectFiles] = []
vulnerable_projects: List[VulnerableProjectFiles] = field(default_factory=list)
for json_file in self._list_all_json_files():
vulnerable = self._read_repository_and_file_names(json_file)
if not self.should_accept_project(vulnerable.project_name):
Expand Down Expand Up @@ -269,7 +269,7 @@ def submodule_files(self) -> List[str]:
We're not going to be fixing pom files in Git submodules so this allows us to filter them out.
"""
files: List[str] = []
files: List[str] = field(default_factory=list)
submodule_file_path: str = self.project_file_name() + '/.gitmodules'
if not os.path.isfile(submodule_file_path):
return []
Expand All @@ -283,7 +283,7 @@ async def do_fix_vulnerabilities(self) -> VulnerabilityFixReport:
project_vulnerabilities_fixed = 0
project_files_fixed = 0
submodules = self.submodule_files()
files_fixed: List[str] = []
files_fixed: List[str] = field(default_factory=list)
for file in self.project_files.files:
# Skip submodule files
skip = next((True for submodule in submodules if file.startswith(submodule)), False)
Expand Down

0 comments on commit 12c745b

Please sign in to comment.