Commit Graph

5 Commits

Author SHA1 Message Date
David Racine d912fd2c01 docs: document clang-format 14 setup and add an opt-in pre-commit hook (#6741)
Recent distros and Homebrew ship only newer clang-format, so contributors
can't easily get the version CI uses (14, matching the OoT/MM decomp).

- docs/FORMATTING.md: how to get a 14.x binary (apt, AUR, muttleyxd static
  binaries, uvx/pipx wheel, brew) and how to run the formatter.
- run-clang-format.sh: default to clang-format-14 but honor $CLANG_FORMAT so
  any matching binary works. Any 14.x produces byte-identical output here.
- .pre-commit-config.yaml: opt-in hook to format staged C/C++ on commit.
- README: link the new doc.

The llvm@14 formula is available on Linux too, so filing it under a
macOS-only heading was too narrow.

* Support spaced paths in CLANG_FORMAT; document run-clang-format.ps1

eval the clang-format invocation so CLANG_FORMAT can carry arguments
(uvx clang-format@14) or a quoted path with spaces without one breaking
the other. The NUL-separated file list reaches xargs over the pipe, so
filenames never pass through eval.

Document the native Windows run-clang-format.ps1 path alongside the Git
Bash/WSL route.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 03:22:28 +00:00
Archez f37c3aa228 clang-format .hpp files (#5307)
* Add hpp files to clang-format script

* clang-format hpp files
2025-04-03 23:33:35 -04:00
Archez 2deea6e105 Better verbose output for clang-format (#5306) 2025-04-03 15:23:47 -04:00
Philip Dubé ef8fa17e7c simplify clang-format script (#5274)
checked that -print0 & -0 also exist in apple's manpages
2025-04-03 00:36:10 -04:00
Archez e8389e0b2e Add clang-format scripts and github runner action (#5270) 2025-04-01 17:09:44 -04:00