Skip to content

[build]: Lint/format tooling + CI (add-lint-tooling) - #35

Merged
haoyu-zc merged 2 commits into
refacotring-07-16-2026from
pr-c-add-lint-tooling
Jul 16, 2026
Merged

[build]: Lint/format tooling + CI (add-lint-tooling)#35
haoyu-zc merged 2 commits into
refacotring-07-16-2026from
pr-c-add-lint-tooling

Conversation

@haoyu-zc

@haoyu-zc haoyu-zc commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Implements OpenSpec change add-lint-tooling (proposal 2/8).

Two commits: (1) config/CI (reviewable) and (2) mechanical format (tool-generated — ruff format + clang-format + ruff safe autofixes).

Config (commit 1)

  • Root pyproject.toml: single-source ruff config (the config was deleted with the scaffold in the cleanup PR and is recreated here). Rules B,I,ARG,C4,EM,PL,PT,PTH,RET,SIM,UP,NPY,PD (+E/F/W); a documented ignore list separates formatter-owned codes from logic-adjacent ones deferred to follow-up (NPY002 legacy RNG, PLC0415 lazy imports, EM/PTH/B905/PLW1510 behavior-changing). analysis/ and docs/ excluded.
  • .pre-commit-config.yaml: drop black/black-jupyter; bump ruff to 0.15.1; add scoped mirrors-clang-format.
  • .clang-format (Microsoft/4-space/120/PointerAlignment Right/sorted includes), .clang-tidy (curated checks).
  • CMakeLists.txt: export compile_commands.json.
  • .github/workflows/ci.yml: lint (ruff + clang-format check), build + test-cpu (CUDA devel container; GPU tests remain local).

Mechanical format (commit 2) — scope: libs/ccc, tests, libs/ccc_cuda_ext; analysis/ untouched

Python ruff format + safe autofixes (import sorting, unused-import removal in tests, Union|, .format→f-string, redundant open mode, NPY201 np.unicode_np.str_); CUDA clang-format -i. The NPY201 fix incidentally resolves the 2 pre-existing NumPy-2 test failures — the suite is now fully green.

Testing

Rebuilt in ccc-gpu-dev; 216 passed (was 214 + 2 previously-failing now fixed). ruff check, ruff format --check, and clang-format --dry-run --Werror all clean. CI YAML validated (Actions not executed locally).

Haoyu Zhang and others added 2 commits July 16, 2026 16:17
…ling)

OpenSpec change: add-lint-tooling. Single-source lint/format config + CI.

- pyproject.toml: recreate the ruff config (deleted with the scaffold in the
  cleanup PR) at the root as the single source; rule set B,I,ARG,C4,EM,PL,PT,
  PTH,RET,SIM,UP,NPY,PD (+E/F/W); documented ignore list splits formatter-owned
  codes from logic-adjacent codes deferred to follow-up; per-file-ignores for
  tests; analysis/ and docs/ excluded.
- .pre-commit-config.yaml: drop black/black-jupyter (ruff-format replaces them),
  bump ruff to v0.15.1, add mirrors-clang-format hook scoped to the extension.
- .clang-format (Microsoft/4-space/120/PointerAlignment Right/sorted includes)
  and .clang-tidy (curated bugprone/performance/modernize checks).
- CMakeLists.txt: export compile_commands.json for clang-tidy.
- .github/workflows/ci.yml: lint (ruff + clang-format check), build, and
  CPU-test jobs (build/test use a CUDA devel container; GPU tests remain local).
- .git-blame-ignore-revs for the mechanical format commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mechanical, tool-generated formatting of the package, tests, and CUDA
extension (scope: libs/ccc, tests, libs/ccc_cuda_ext; analysis/ untouched).
No behavior change intended.

- Python: `ruff format` reflow + `ruff check --fix` safe fixes only
  (import sorting, unused-import removal in tests, Union->|, .format->f-string,
  redundant open mode, NPY201 np.unicode_->np.str_).
- CUDA/C++: `clang-format -i` (Microsoft base, 4-space, 120 cols, sorted
  includes within each group; local headers unmoved).

The NPY201 fix (np.unicode_->np.str_) in tests/test_coef_pval.py incidentally
resolves the 2 pre-existing NumPy-2 test failures — they now pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@haoyu-zc

Copy link
Copy Markdown
Collaborator Author

Codex review (codex review --base): no actionable correctness regressions — mechanical formatting + safe modernization. Verified: 216 passed (the 2 pre-existing NumPy-2 failures are fixed by the NPY201 autofix); ruff/clang-format/CI-YAML all clean.

@haoyu-zc
haoyu-zc merged commit c0ae4ad into refacotring-07-16-2026 Jul 16, 2026
3 checks passed
@haoyu-zc
haoyu-zc deleted the pr-c-add-lint-tooling branch July 16, 2026 22:18
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