Skip to content

chore(lint): adopt ruff + pre-commit, gate CI on lint job#83

Open
tomz wants to merge 1 commit into
microsoft:mainfrom
tomz:pr1-lint-core
Open

chore(lint): adopt ruff + pre-commit, gate CI on lint job#83
tomz wants to merge 1 commit into
microsoft:mainfrom
tomz:pr1-lint-core

Conversation

@tomz
Copy link
Copy Markdown

@tomz tomz commented May 29, 2026

Part 1/5 of a stack: #1 (lint)#2 (cloud engines) → #3 (cli) → #4 (tpcdi) → #5 (databricks). Best reviewed in order; each builds on the previous. All five branch off the same main tip.

What

Adopts ruff as the single linter + formatter and wires it into pre-commit and CI.

  • Add ruff config to pyproject.toml (lint + format).
  • Add .pre-commit-config.yaml.
  • Run ruff format across the repo (the bulk of the diff — pure formatting, no behavioral change).
  • Add a dedicated lint job to CI and make it enforcing (the format check fails the build; no || true escape hatch).

Why

One tool for lint + format, a fast local guard via pre-commit, and a CI gate so formatting drift can't land again.

Notes for reviewers

  • The large line count is overwhelmingly mechanical reformatting; review the pyproject.toml / .pre-commit-config.yaml / CI workflow changes and skim the rest.
  • W291/W293 (trailing whitespace) are intentionally ignored: they occur inside triple-quoted SQL string literals where the whitespace is part of the query text, and ruff format correctly leaves those untouched. Rationale is documented inline in pyproject.toml.

Tests

ruff check + ruff format --check clean; suite green (24 passed).

Add a conservative ruff config (E/F/I/W), a pre-commit hook set, and a CI
lint job (lint + format both enforcing). Reformat the existing tree with
`ruff format` and replace ad-hoc print() diagnostics with module-level
loggers across datagen and timing helpers. Fix obvious nits surfaced by ruff
(import order, bare except -> except Exception, dead assignment).

Drop Python 3.8 support and move pyarrow to base dependencies (the core
results/timing modules import it unconditionally). Gitignore scratch/ for
workspace-specific scratchpads.

W291/W293 stay globally ignored because trailing whitespace inside multi-line
SQL string literals is intentional and not touched by `ruff format`.
@tomz
Copy link
Copy Markdown
Author

tomz commented May 29, 2026

Context: this is part 1/5 of the stack proposed in #82. The remaining four PRs (cloud engines, CLI, TPC-DI, Databricks Connect) will follow sequentially against main as this merges — unless you'd prefer a different workflow (see #82).

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.

1 participant