Skip to content

Commit

Permalink
Adding flake8 to ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
dougollerenshaw committed Oct 4, 2024
1 parent 640375b commit e79d0a0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 88
extend-ignore = E203, E266, E501, W503
select = B,C,E,F,W,T4,B9
27 changes: 27 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Flake8 Linter

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 flake8-unused-arguments
- name: Run Flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./codeaide --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 ./codeaide --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
15 changes: 14 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-unused-arguments]
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ black
isort
pre-commit
pyqt5
pygments
pygments
flake8
flake8-unused-arguments

0 comments on commit e79d0a0

Please sign in to comment.