Skip to content

ci: lint Python with flake8 defaults and fit the drift check to them - #400

Merged
nic-6443 merged 1 commit into
mainfrom
fix/flake8-defaults
Oct 8, 2026
Merged

nic-6443 merged 1 commit into
mainfrom
fix/flake8-defaults

Conversation

@jarvis9443

@jarvis9443 jarvis9443 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Downstream mirrors of this repo lint Python with flake8 defaults (79-character lines, every default check), and .github/scripts/check-aisix-config-drift.py had ten lines past 79 columns, so it fails those gates.

This rewraps those lines. It's formatting only: long strings are split into adjacent literals and long expressions are wrapped in parentheses, so the parsed AST is identical to before and the script prints exactly the same messages.

To keep it that way, CI gets a Python lint job that installs flake8 7.3.0 and runs flake8 --isolated over every tracked *.py file (found with git ls-files, so a new script is covered without editing the workflow). --isolated ignores config files, so nobody can loosen the defaults by adding a .flake8 or setup.cfg. .pre-commit-config.yaml gets the matching flake8 hook with the same --isolated arg, so local commits catch it too.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added automated Python style checks to the project’s continuous integration and pre-commit workflows.
    • Updated formatting in an existing configuration-checking script; its behavior and messages remain unchanged.
    • No user-facing changes are included.

Downstream mirrors lint every Python file with flake8 defaults (79-column
lines), and check-aisix-config-drift.py had ten longer lines. Rewrap them
(formatting only; the parsed AST is unchanged) and add a Python lint job plus
a pre-commit hook that run flake8 7.3.0 with --isolated over every tracked
*.py file, so a new script is held to the same defaults.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 34a80759-d5c3-4f8f-82af-fe96e05b2747
📥 Commits

Reviewing files that changed from the base of the PR and between 35f240d and 2c94310.

📒 Files selected for processing (3)
  • .github/scripts/check-aisix-config-drift.py
  • .github/workflows/ci.yaml
  • .pre-commit-config.yaml

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The pull request adds a pinned flake8 hook and a CI lint job. It also reformats the AI Six configuration drift-check script without changing its behavior.

Changes

Python lint checks

Layer / File(s) Summary
Configure and run flake8
.pre-commit-config.yaml, .github/scripts/check-aisix-config-drift.py, .github/workflows/ci.yaml
Adds a flake8 7.3.0 pre-commit hook and a CI job that lints tracked Python files with isolated defaults. Reformats the drift-check script without changing its behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 2c943

The new lint check passes on the tracked Python file, and no actionable write-permission risk was established. No merge-blocking issue remains.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding Flake8 linting to CI and pre-commit, and reformatting the drift-check script to satisfy Flake8 defaults.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
E2e Test Quality Review ✅ Passed The PR is limited to Python formatting and lint enforcement. The reviewed script has valid syntax and an identical AST to the base version. The existing CI workflow already runs real Helm/Kubernetes c…
Security Check ✅ Passed No security findings were introduced. 1. Sensitive Data Exposure in Logs & Responses — No issues found. The AST of the drift-check script is identical before and after the change, including its existi…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@nic-6443
nic-6443 merged commit 688c0d3 into main Oct 8, 2026
4 checks passed
@nic-6443
nic-6443 deleted the fix/flake8-defaults branch October 8, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants