Run flake8 linter on github workflow
This commit is contained in:
parent
f2d6c198cc
commit
d66e2b77fd
|
@ -47,9 +47,6 @@ jobs:
|
|||
sudo apt-get update -qy
|
||||
sudo apt-get -y install postgresql-client
|
||||
python -m pip install --upgrade pip
|
||||
pip install virtualenv
|
||||
virtualenv env
|
||||
source env/bin/activate
|
||||
pip install flake8 pytest coverage
|
||||
pip install -r requirements.txt
|
||||
|
||||
|
@ -65,6 +62,17 @@ jobs:
|
|||
psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION citext SCHEMA public;"
|
||||
psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pg_trgm SCHEMA public;"
|
||||
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if:
|
||||
# - E9,F63,F7,F82: Python syntax errors or undefined names
|
||||
# - E501: line longer than 120 characters
|
||||
# - C901: complexity greater than 10
|
||||
# - F401: modules imported but unused
|
||||
# See: https://flake8.pycqa.org/en/latest/user/error-codes.html
|
||||
flake8 . --select=E9,F63,F7,F82,E501,C901,F401
|
||||
flake8 . --exit-zero
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
export SECRET_KEY=`python3 -c 'import secrets; print(secrets.token_hex())'`
|
||||
|
|
Reference in New Issue