From 21ed3923e445ccc4058375062608eb2387d29132 Mon Sep 17 00:00:00 2001 From: Divyaranjan Sahoo Date: Sun, 5 Oct 2025 20:47:01 +0530 Subject: [PATCH] chore(ci): add flake8 lint workflow and fix minor lint issue - Add GitHub Actions workflow to run flake8 on push and PR - Align Python version with Dockerfile (3.8) - Fix unused variable in exception handler to satisfy flake8 Refs: #59 --- .github/workflows/lint.yml | 28 ++++++++++++++++++++++++++++ github-dork.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..038f261 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Lint (flake8) + +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "**" ] + +jobs: + flake8: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - name: Install flake8 + run: | + python -m pip install --upgrade pip + pip install flake8 + + - name: Run flake8 + run: | + flake8 . diff --git a/github-dork.py b/github-dork.py index 713cbc1..2941b04 100644 --- a/github-dork.py +++ b/github-dork.py @@ -28,7 +28,7 @@ def search_wrapper(gen): yield next(gen) except StopIteration: return - except github.exceptions.ForbiddenError as e: + except github.exceptions.ForbiddenError: search_rate_limit = gh.rate_limit()['resources']['search'] # limit_remaining = search_rate_limit['remaining'] reset_time = search_rate_limit['reset']