Skip to content

Add pre-commit hooks with ruff, clang-format, and line-ending enforcement#31

Merged
ardiloot merged 3 commits intomasterfrom
pre-commit
Feb 19, 2026
Merged

Add pre-commit hooks with ruff, clang-format, and line-ending enforcement#31
ardiloot merged 3 commits intomasterfrom
pre-commit

Conversation

@ardiloot
Copy link
Copy Markdown
Owner

Add pre-commit hooks for automated code formatting and linting.

Configuration

  • .pre-commit-config.yaml: Hook configuration
  • .clang-format: C++ formatting rules (LLVM-based, C++17, 120 col)
  • pyproject.toml: Ruff config, replaced flake8 with ruff

Hooks

Hook Purpose
mixed-line-ending Enforce LF line endings (per .gitattributes)
end-of-file-fixer Ensure files end with single newline
trailing-whitespace Remove trailing whitespace
ruff Python linter (replaces flake8)
ruff-format Python formatter
clang-format C++ formatter (project files only)

Exclusions

  • Vendored eigen-3.4.0/ excluded globally
  • Cython .pyx/.pxd files excluded from ruff (unsupported)
  • Per-file lint ignores for legacy test helpers and physics variable names

Commits

  1. Config files (hooks, clang-format, pyproject.toml)
  2. Apply formatters to entire codebase

@ardiloot ardiloot merged commit 5a6cfdb into master Feb 19, 2026
11 checks passed
@ardiloot ardiloot deleted the pre-commit branch February 19, 2026 19:11
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