Skip to content

Commit e56b2b6

Browse files
committed
Fix pre-existing CodeQL warnings
- common.py get_git_branch: add explicit return when no branch found - common.py is_same_pivot: add explicit return False for non-matching - torch_ani.py write_input_file: match parent class signature
1 parent 31c767b commit e56b2b6

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

arc/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def get_git_branch(path: str | None = None) -> str:
314314
for branch_name in branch_list:
315315
if '*' in branch_name.decode():
316316
return branch_name.decode()[2:]
317+
return ''
317318
else:
318319
return ''
319320

@@ -1365,6 +1366,7 @@ def is_same_pivot(torsion1: list | str,
13651366
return False
13661367
if torsion1[1:3] == torsion2[1:3] or torsion1[1:3] == torsion2[1:3][::-1]:
13671368
return True
1369+
return False
13681370

13691371

13701372
def is_same_sequence_sublist(child_list: list, parent_list: list) -> bool:

arc/job/adapters/torch_ani.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def __init__(self,
179179
xyz=xyz,
180180
)
181181

182-
def write_input_file(self, settings: dict) -> None:
182+
def write_input_file(self, settings: dict | None = None) -> None:
183183
"""
184184
Write the input file to execute the job on the server.
185185
"""

0 commit comments

Comments
 (0)