diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..5ed284e --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +ignore = E226,E302,E41,F401,W503,F405,W503,F841,F403,E402,F821,W291 +max-line-length = 160 + diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..539a2b3 --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,20 @@ +name: Flake8 Check + +on: [push, pull_request] + +jobs: + lint: + name: Linting with Flake8 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Installing Dependencies + run: | + python -m pip install --upgrade pip + pip install flake8==3.8.4 + - name: Running QA-CHECKS + run: ./flake8-check \ No newline at end of file diff --git a/flake8-check b/flake8-check new file mode 100755 index 0000000..c3081b6 --- /dev/null +++ b/flake8-check @@ -0,0 +1,13 @@ +#!/bin/bash + +flake8-check() { + flake8 && echo "Flake8 Check ✅" ||{ + >&2 echo "Flake8 Check ❌" + echo "Suggestion: Run - flake8 ." + echo "" + FAILURE=1 + } +} + +flake8-check +exit $FAILURE \ No newline at end of file