Skip to content

Commit

Permalink
add missing bandit to GitHub CI and apply bandit fixes (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault authored Nov 9, 2022
1 parent b86efc7 commit 7662c7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
py-ver-major: [3]
py-ver-minor: [6, 7, 8, 9, 10, 11]
step: [lint, unit, mypy]
step: [lint, bandit, unit, mypy]
exclude:
- py-ver-major: 3
py-ver-minor: 6
Expand Down
12 changes: 8 additions & 4 deletions schema_salad/cpp_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,21 @@ def safename2(name: Dict[str, str]) -> str:
# into its class path and non class path
def split_name(s: str) -> Tuple[str, str]:
t = s.split("#")
assert len(t) == 2
if len(t) != 2:
raise ValueError(
"Expected field to be formatted as 'https://xyz.xyz/blub#cwl/class'."
)
return (t[0], t[1])


# similar to split_name but for field names
def split_field(s: str) -> Tuple[str, str, str]:
(namespace, field) = split_name(s)
t = field.split("/")
assert len(t) == 2
if len(t) != 2:
raise ValueError(
"Expected field to be formatted as 'https://xyz.xyz/blub#cwl/class'."
)
return (namespace, t[0], t[1])


Expand Down Expand Up @@ -596,8 +602,6 @@ def parse(self, items: List[Dict[str, Any]]) -> None:
types = {i["name"]: i for i in items} # type: Dict[str, Any]

for stype in items:
assert "type" in stype

if "type" in stype and stype["type"] == "documentation":
continue

Expand Down

0 comments on commit 7662c7f

Please sign in to comment.