Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bandit to CI #30

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
workflow_dispatch:

jobs:
test-python:
perform-checks:
name: "Test, Lint & Coverage"
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -44,5 +45,7 @@ jobs:
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
debug: true

- name: "Bandit Code Scan"
if: always()
run: poetry run bandit -c pyproject.toml -r -l .
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ indent-style = "space"
skip-magic-trailing-comma = false

[tool.mypy]
python_version = "3.12.3"
python_version = "3.12"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was showing a warning in mypy tasks since its not required to have patch version.

plugins = ['pydantic.mypy']
strict = true
ignore_missing_imports = true
Expand Down Expand Up @@ -78,7 +78,6 @@ bandit = {version = "1.8.*", extras = ["toml"]}

[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101"] # https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asserts are only used in tests, and we already exclude tests dir from bandit


[build-system]
requires = ["poetry-core"]
Expand Down
Loading