From 7053cb1227c2e167d181dc3642884afe2706a474 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 14 Aug 2025 16:39:52 +0000 Subject: [PATCH 1/3] add linting to github workflow --- .github/workflows/python-app.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 380b470..1963f12 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -19,7 +19,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest + pip install pytest flake8 + - name: Lint with flake8 + run: | + # Stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # Treat all errors as warnings and set complexity and line length limits + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Run tests run: | pytest From 00ca28a56e2bb69a4dc51f800fd89e9879d881b4 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 14 Aug 2025 16:41:31 +0000 Subject: [PATCH 2/3] intentional testing error --- test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_main.py b/test_main.py index 96d82a8..33cb5f0 100644 --- a/test_main.py +++ b/test_main.py @@ -2,7 +2,7 @@ from main import is_even def test_is_even_with_even_number(): - assert is_even(4) == True + assert is_even(3) == True def test_is_even_with_odd_number(): assert is_even(5) == False From d6c93c34b06721a8fed3a2cf01f24c4ea4a0992a Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 14 Aug 2025 16:43:08 +0000 Subject: [PATCH 3/3] resolve testing error --- test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_main.py b/test_main.py index 33cb5f0..96d82a8 100644 --- a/test_main.py +++ b/test_main.py @@ -2,7 +2,7 @@ from main import is_even def test_is_even_with_even_number(): - assert is_even(3) == True + assert is_even(4) == True def test_is_even_with_odd_number(): assert is_even(5) == False