Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,18 @@ repos:
rev: v0.10.0
hooks:
- id: shellcheck

# Trunk delegate. The pre-commit framework is this repo's single git-hook
# entry point; `trunk fmt` is invoked here so devs only ever need to run
# `pre-commit install` once. trunk's own `trunk-fmt-pre-commit` action is
# disabled in .trunk/trunk.yaml to avoid double-installing the git hook.
- repo: local
hooks:
- id: trunk-fmt
name: trunk fmt
description: Apply trunk-owned formatters (prettier, buildifier, …)
language: system
entry: trunk fmt --no-progress
pass_filenames: true
require_serial: true
types_or: [text]
9 changes: 8 additions & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ lint:
actions:
enabled:
- trunk-announce
- trunk-upgrade-available
# `trunk-fmt-pre-commit` and `trunk-check-pre-push` install their own
# `.git/hooks/{pre-commit,pre-push}` scripts, which conflicts with
# `pre-commit install` (last installer wins). The pre-commit framework is
# this repo's single entry point — it owns the git hook and delegates to
# trunk via a `local` hook in .pre-commit-config.yaml. Devs run
# `pre-commit install` once; CI runs both jobs independently.
disabled:
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ The project only comes with a Bazel BUILD.bazel file and can be added to other B

The project is formatted with specific clang-format settings which require clang 16+ (in case of MacOs LLVM 16+ can be installed using brew). For simplicity in dev mode the project pulls the appropriate clang tools and can be compiled with those tools using `bazel [build|test] --config=clang ...`.

Lint and format are driven by [Trunk](https://docs.trunk.io/cli). Devs are **required** to install the CLI locally — `curl https://get.trunk.io -fsSL | bash` — then run `trunk check` and `trunk fmt` before pushing. The repo enables `trunk-fmt-pre-commit` and `trunk-check-pre-push` so the hooks run automatically once installed. CI runs `trunk check` only (no auto-fixing on the GitHub side); failing lint must be fixed locally and re-pushed.
Lint and format are driven by [Trunk](https://docs.trunk.io/cli) plus [pre-commit](https://pre-commit.com). Devs are **required** to install both — `curl https://get.trunk.io -fsSL | bash` and `pip install pre-commit` (or your package manager's equivalent) — then run `pre-commit install` once. The pre-commit framework is this repo's single git-hook entry point and delegates `trunk fmt` to trunk on every commit. CI runs both `pre-commit` and `trunk check` jobs; failing lint must be fixed locally and re-pushed.

### WORKSPACE

Expand Down
2 changes: 1 addition & 1 deletion bazelmod/dev.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
commit = "6f0f6e4f8c6722316e2e48ba50c157a6a3c3404b",
commit = "abb61a688167623088f8768cc9264798df6a9d10",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)

Expand Down
Loading