Skip to content

Commit

Permalink
Simplify Bandit
Browse files Browse the repository at this point in the history
Signed-off-by: Steven K <[email protected]>
  • Loading branch information
rh0dium committed Dec 28, 2023
1 parent 28bb365 commit f2a0ca8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
pip install .[test]
- name: Bandit
run: bandit -r appsearch -x appsearch/tests -s B308,B703,B303,B324 -f json -o report.json
run: bandit -c pyproject.toml -f json -o report.json

- name: Show report
if: ${{ success() || failure() }}
Expand All @@ -107,7 +107,7 @@ jobs:
tests:
name: Python ${{ matrix.python-version }} / ${{ matrix.db }} / Django ${{ matrix.django-version}}
runs-on: ubuntu-latest
# continue-on-error: ${{ matrix.django-version == '~=4.2.0' }}
# continue-on-error: ${{ matrix.django-version == '~=5.0' }}
strategy:
max-parallel: 4
matrix:
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
PYTHONWARNINGS: once::DeprecationWarning
TASK_ALWAYS_EAGER: 1
DB_TYPE: ${{ matrix.db }}
run: export PYTHONPATH=`pwd` && coverage run demo_app/manage.py test --noinput --settings=demo_app.settings_test appsearch
run: export PYTHONPATH=`pwd` && coverage run
- name: "Upload Coverage Results for PY:${{ matrix.python-version }} DB:${{ matrix.db}} DJ:${{ matrix.django-version }}"
uses: actions/upload-artifact@v3
with:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ extend-exclude = '''
/static/.py # exclude a file named foo.py in the root of the project (in addition to the defaults)
'''

# -r appsearch -x appsearch/tests -s B308,B703,B303,B324 -f json -o report.json
[tool.bandit]
targets = ['appsearch']
exclude_dirs = ["appsearch/tests"]
skips = ["B308", "B703", "B303", "B324"]

[tool.coverage.run]
branch = true
command_line = "demo_app/manage.py test --noinput --settings=demo_app.settings_test appsearch"
omit = [
"*/demo_app/**",
"*/migrations/*",
Expand Down

0 comments on commit f2a0ca8

Please sign in to comment.