diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..248341e --- /dev/null +++ b/.flake8 @@ -0,0 +1,12 @@ +[flake8] +max-line-length = 100 +exclude = .venv +ignore = + # disable, whitespace before ':' https://github.com/TCLResearchEurope/ctw-pre-commit-hooks/issues/3 + E203, + # disable "too many leading '#' for block comment" + E266, + # disable "line break before binary operator" which clashes with black + W503, + # disable "invalid escape sequence" + W605, \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43eb5b0..fd17871 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,15 @@ jobs: run: | pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt + - name: Check format with black + run: black --check --extend-exclude tests . + + - name: Check style with flake8 + run: flake8 --extend-exclude tests . + + - name: Check import sorting with isort + run: isort --check --extend-skip tests . + - name: Run model tests run: make model-test diff --git a/challenge/__init__.py b/challenge/__init__.py index 2ff3226..6667b20 100644 --- a/challenge/__init__.py +++ b/challenge/__init__.py @@ -1,3 +1,3 @@ from challenge.api import app -application = app \ No newline at end of file +application = app