From c5b827e588d646cf4f10646c2c8ece7550c1bfa5 Mon Sep 17 00:00:00 2001 From: Anthony Hashemi Date: Wed, 25 Oct 2023 18:44:22 +0100 Subject: [PATCH 1/2] Fix python app check workflow --- .github/workflows/python-app.yml | 4 ++-- pyproject.toml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b45ab004..cec5d249 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.11"] steps: - uses: actions/checkout@v3 @@ -27,7 +27,7 @@ jobs: - name: Check dependencies for known security vulnerabilities run: safety check -r requirements.txt - name: Check code for potential security vulnerabilities - run: bandit -r . + run: bandit -c pyproject.toml -r . - name: Check code formatting run: black . -l 120 --check - name: Lint with flake8 diff --git a/pyproject.toml b/pyproject.toml index 1c3b76d2..a02e70bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,9 @@ description = "" authors = ["Your Name "] readme = "README.md" +[tool.bandit] +exclude_dirs = ['*_test.py', '*/test_*.py', 'venv'] + [tool.poetry.dependencies] python = "^3.11" cssmin = "0.2.0" From d1b1f4f2a4ec799f8b6318a13ce3e11c2a055b52 Mon Sep 17 00:00:00 2001 From: Anthony Hashemi Date: Wed, 25 Oct 2023 18:52:59 +0100 Subject: [PATCH 2/2] Use standard 88 lines for black check in workflow --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index cec5d249..357293b3 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -29,7 +29,7 @@ jobs: - name: Check code for potential security vulnerabilities run: bandit -c pyproject.toml -r . - name: Check code formatting - run: black . -l 120 --check + run: black . --check - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names