How to Enforce Code Quality#

Set up pre-commit hooks#

pre-commit install

Run all checks manually:

pre-commit run --all-files

Hook definitions are maintained in eclipse-score/tooling. Checks include formatting, YAML validation, copyright headers, and lock file freshness.

Apply C++ policies#

score_cpp_policies centralizes:

  • Warning baselines

  • Sanitizer feature selections (ASan, UBSan, LSan, TSan)

  • Constraint targets

Consume these policies as a Bazel dependency to apply consistent C++ quality rules across repositories.

Apply Rust policies#

score_rust_policies packages:

  • Shared Clippy lint rules

  • rustfmt defaults

Understand where checks run#

Stage

What runs

Speed

Local (pre-commit)

Formatting, YAML, copyright headers, lock files

Seconds

Bazel build

Compiler warnings, lint policies, sanitizers

Minutes

CI

Full test suite, coverage, compliance checks

Minutes

Pre-commit catches formatting and hygiene fast. Bazel enforces deeper checks. CI is the final gate.