Skip to content

Migrate the PR-CI lint gate from flake8 to ruff #567

Merged
auxten merged 1 commit into
chdb-io:mainfrom
ShawnChen-Sirius:feat/lint-migrate-to-ruff
May 13, 2026
Merged

Migrate the PR-CI lint gate from flake8 to ruff #567
auxten merged 1 commit into
chdb-io:mainfrom
ShawnChen-Sirius:feat/lint-migrate-to-ruff

Conversation

@ShawnChen-Sirius

@ShawnChen-Sirius ShawnChen-Sirius commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace flake8 datastore with ruff check datastore as the PR-CI
lint gate. Pure drop-in: same rule selection (E9, F63, F7, F82),
same ignores (F811, __init__.py:F401), same line-length (120),
same exclude list. No .py source files change.

Resolves #566.

Type of change

  • chore — tooling, dependencies, housekeeping

Linked issues

Closes #566

How to verify

Locally on this branch (verified):

python3 -m venv /tmp/ruff-verify && /tmp/ruff-verify/bin/pip install -q ruff
/tmp/ruff-verify/bin/ruff --version              # ruff 0.15.12                                                                                                                                                    
/tmp/ruff-verify/bin/ruff check datastore --no-cache --verbose                                                                                                                                                     
# → "Checked 43 files in: 6.735333ms"                                                                                                                                                                              
# → "All checks passed!"                                                                                                                                                                                           
                                                                                                                                                                                                                   
Behaviour parity confirmed:                                                                                                                                                                                        
- 43 datastore/*.py files scanned (matches the count of non-test
.py files in datastore/)                                                                                                                                                                                           
- __init__.py:F401 per-file-ignore correctly applied   
(visible in verbose log)                                                                                                                                                                                           
- datastore/tests/ correctly excluded                                                                                                                                                                              
- Zero findings — same result as the current flake8 datastore run                                                                                                                                                  
                                                                                                                                                                                                                   
Checklist                                                                                                                                                                                                          
                                                       
- No .py source code changes — tooling-only migration                                                                                                                                                              
- Locally verified ruff matches flake8 behaviour on the current
datastore/ (zero findings, see above)                                                                                                                                                                              
- N/A — no DataStore semantics touched                                                                                                                                                                             
- Configuration moved from setup.cfg to pyproject.toml                                                                                                                                                             
[tool.ruff] (consolidates with existing [tool.pyright] and                                                                                                                                                         
[tool.pytest.ini_options])                                                                                                                                                                                         
- No new runtime deps; requirements-dev.txt swaps                                                                                                                                                                  
flake8>=6.0.0 → ruff>=0.5.0                                                                                                                                                                                        
                                                                                                                                                                                                                   
Notes for reviewers                                                                                                                                                                                                
                                                                                                                                                                                                                   
Files changed (4, +27/-22):                                                                                                                                                                                        
 
┌──────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────┐                                                                           
│             File             │                                                Change                                                 │
├──────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ pyproject.toml               │ New [tool.ruff] and [tool.ruff.lint] sections; same rule semantics as the previous setup.cfg [flake8] │
├──────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ requirements-dev.txt         │ flake8>=6.0.0 → ruff>=0.5.0                                                                           │                                                                           
├──────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                           
│ setup.cfg                    │ Removed (only contained [flake8]; nothing else read it in this repo)                                  │                                                                           
├──────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                           
│ .github/workflows/pr_ci.yaml │ Install + run ruff instead of flake8; comment updated to point at pyproject.toml                      │
└──────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────┘                                                                           
                                                       
Follow-up dependency on [AGENTS.md PR](https://github.com/chdb-io/chdb/pull/565): AGENTS.md sections 2.9,                                                                                                                                                   
6.3, 11 and the new PR template checklist all reference flake8 by
name. After both PRs merge, a small doc-only follow-up commit will                                                                                                                                                 
update those references to ruff. Kept out of this PR to keep the                                                                                                                                                   
diff strictly scoped to the tooling change and to avoid conflicting                                                                                                                                                
with the AGENTS.md PR.                                                                                                                                                                                             
                                                                                                                                                                                                                   

Drop-in replacement preserving rule selection (E9, F63, F7, F82),
ignores (F811, __init__.py:F401), line-length 120, and the same
exclude list. Verified locally: ruff 0.15.12 scans 43 datastore
files in ~7 ms with zero findings — exact parity with flake8 on
the current codebase.

Files changed:
- pyproject.toml: add [tool.ruff] (config previously in setup.cfg)
- requirements-dev.txt: flake8>=6.0.0 -> ruff>=0.5.0
- setup.cfg: removed (only contained the [flake8] section)
- .github/workflows/pr_ci.yaml: install + invoke ruff

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@auxten auxten changed the title chore: migrate the PR-CI lint gate from flake8 to ruff Migrate the PR-CI lint gate from flake8 to ruff May 13, 2026
@auxten auxten merged commit 7c4a5e8 into chdb-io:main May 13, 2026
6 checks passed
ShawnChen-Sirius added a commit to ShawnChen-Sirius/chdb that referenced this pull request May 14, 2026
Migrate chdb's CLAUDE.md (chdb-ds Design and Testing Principles) to
AGENTS.md, keeping the content unchanged but reformatting it to
follow the agents.md open standard (https://agents.md). AGENTS.md is
deliberately short — it stays loaded in AI coding agent context at
all times, so it only carries the design and testing principles.

Everything human-facing (setup, the modify-then-test workflow,
things to avoid, PR conventions, CI matrix, security, maintainer
release flow) moves into CONTRIBUTING.md. README.md, the PR
template, and the issue templates now point contributors there.

Companion changes:

- Replace the inherited ClickHouse-upstream .github/ISSUE_TEMPLATE/
  set with chdb-specific bug_report.md, feature_request.md,
  performance_issue.md, and a config.yml routing block.
- Modernise .github/PULL_REQUEST_TEMPLATE.md and adopt the
  ClickHouse-style PR title convention (Capitalised verb start,
  no Conventional-Commit prefix).
- Repoint .cursor/rules/{chdb,chdb-ds,git-conventions}.mdc at
  AGENTS.md / CONTRIBUTING.md instead of duplicating their content.
- Reflect ruff (replacing flake8) as the only PR-gate lint, matching
  upstream PR chdb-io#567.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Proposal: migrate the PR-CI lint gate from flake8 to ruff

2 participants