From c8acb24133618fcbd3770ce0aa731c9e3f51624c Mon Sep 17 00:00:00 2001 From: Fahd AL-KHULAIFI Date: Sat, 7 Jun 2025 14:49:54 +0300 Subject: [PATCH] Add flake8 config and GitHub Actions workflow for linting --- .flake8 | 3 +++ .github/workflows/lint.yml | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .flake8 create mode 100644 .github/workflows/lint.yml diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..b8161403 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 88 +exclude = .venv,venv,build,dist,*.egg-info,__pycache__ \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..51adca5f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,24 @@ +name: Python Linter + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + + - name: Run flake8 + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics