Skip to content

chore: add ruff and clang-format via pre-commit#32

Merged
jaywyawhare merged 2 commits into
masterfrom
chore/add-linter-formatter
Apr 29, 2026
Merged

chore: add ruff and clang-format via pre-commit#32
jaywyawhare merged 2 commits into
masterfrom
chore/add-linter-formatter

Conversation

@jaywyawhare
Copy link
Copy Markdown
Owner

Adds two linting/formatting tools wired through pre-commit:

  • ruff — Python linter and formatter (replaces flake8 + black + isort). Config lives in python/pyproject.toml. _ffi.py and _core.py have targeted ignores to avoid noise from generated/large files.
  • clang-format — C/C++ formatter. Style config in .clang-format (LLVM base, 4-space indent, 100-col limit).

Usage

pip install pre-commit
pre-commit install        # installs git hooks
pre-commit run --all-files  # run manually

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR introduces pre-commit hooks for ruff (Python linting/formatting) and clang-format (C/C++ formatting), along with their respective configuration files. The setup follows standard conventions: ruff lint with --fix runs before ruff-format, versions are pinned, and per-file ignores for _ffi.py and _core.py are well-reasoned given their FFI/C-interop nature.

Confidence Score: 5/5

Safe to merge — purely additive tooling configuration with no logic changes.

All three files are new or additive config; no P0/P1 issues found. Hook order, pinned versions, line-length consistency (100 cols in both ruff and clang-format), and per-file ignores are all correct.

No files require special attention.

Important Files Changed

Filename Overview
.pre-commit-config.yaml New pre-commit config wiring ruff (v0.11.8) and clang-format (v19.1.7); correct hook order (ruff lint+fix before ruff-format), versions pinned.
.clang-format New clang-format config based on LLVM with 4-space indent, 100-col limit, and SortIncludes disabled to preserve order-dependent C includes.
python/pyproject.toml Adds ruff lint/format config; per-file ignores for _ffi.py and _core.py are intentional; E501 globally ignored (standard pattern when ruff-format enforces line length).

Reviews (1): Last reviewed commit: "chore: add ruff (Python linter/formatter..." | Re-trigger Greptile

@jaywyawhare jaywyawhare merged commit 47c8d23 into master Apr 29, 2026
5 checks passed
@jaywyawhare jaywyawhare deleted the chore/add-linter-formatter branch April 29, 2026 10:47
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