From 48d2abc35955842765296a6464965545245bcd83 Mon Sep 17 00:00:00 2001 From: mgcam Date: Wed, 24 Apr 2024 16:11:01 +0100 Subject: [PATCH] Run code checkers in CI --- .flake8 | 4 ++++ .github/workflows/test.yml | 8 ++++++++ tests/test_api.py | 3 --- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..c201160 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 100 +ignore = E251, E265, E261, E302, W503 +per-file-ignores = __init__.py:F401 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4df3427..40019bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,3 +32,11 @@ jobs: - name: Run pytest run: | poetry run pytest + + - name: Run code style checker + run: | + poetry run flake8 + + - name: Run code formatter + run: | + poetry run black --check src diff --git a/tests/test_api.py b/tests/test_api.py index 9376545..4e2a9c0 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,8 +1,5 @@ -import pytest - import npg_porch_cli.api as porchApi - def test_addition(): assert porchApi.add_two(1, 2) == 3