Skip to content

Commit

Permalink
[chore] Add flake8 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryamanz29 committed Apr 8, 2021
1 parent ef41fb2 commit 67d042a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = F401,F405,W503,F841,F403,E402,F821,W291,E266,F811
max-line-length = 120
20 changes: 20 additions & 0 deletions .github/workflows/flake8-check.yml
Original file line number Diff line number Diff line change
@@ -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 Flake8 checks
run: ./flake8-check
13 changes: 13 additions & 0 deletions flake8-check
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 67d042a

Please sign in to comment.