summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-12 17:20:15 +0300
committerPaul Buetow <paul@buetow.org>2026-07-12 17:20:15 +0300
commit1770b12d5d95476310c27ccf39a91b5ba4a3f119 (patch)
treec81bf1d97b5f71140acc73e970abf406f9f64fe7 /.clang-format
parentf2b8ed6d2ea0744cfd1a36a6fbd1763926b873bb (diff)
bootstrap: meson build, test harness, CI, conventions, README/AGENTS (et0)
Phase 0 (task et0): lays the build/test/CI/convention groundwork before any feature code. - meson.build: project ggaze C11 -Wall -Wextra; deps gtk4/glib/gio/libadwaita; feature options gegl/jxl/avif/heif (auto); generated ggaze-config.h with app id, version, GGAZE_HAVE_* feature flags. - tests: GLib g_test harness with separate unit/integration suites (--suite unit / --suite integration); test_bootstrap sanity test proves the harness compiles and the config header is reachable; -Db_coverage=true coverage target wired. - CI: .woodpecker/ci.yml three lanes (minimal, gegl, asan) with xvfb for the integration track and a coverage lane that warns until M10. - conventions: .clang-format (3-space, 80-col, K&R, *-on-var, return type on its own line) + .editorconfig matching docs/coding-conventions.md; CI clang-format --dry-run -Werror gate. - top-level README.md (humans) and AGENTS.md (agents) pointing into docs/. - LICENSE (GPL-3.0-or-later), .gitignore, dir placeholders. Acceptance: meson setup build && ninja -C build && meson test -C build green; clang-format --dry-run --Werror clean.
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format46
1 files changed, 46 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..05e8ba5
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,46 @@
+---
+# ggaze .clang-format — matches docs/coding-conventions.md and the
+# c-best-practices skill. Enforced in CI with `clang-format --dry-run -Werror`.
+Language: Cpp
+BasedOnStyle: LLVM
+
+# 3-space indent, no tabs, 80-col limit.
+# (UseTab singular is the canonical clang-format key across LLVM >=16; the
+# older plural spelling is rejected by current toolchains.)
+ColumnLimit: 80
+IndentWidth: 3
+UseTab: Never
+TabWidth: 3
+ContinuationIndentWidth: 3
+
+# K&R braces (opening brace on the same line).
+BreakBeforeBraces: Attach
+
+# Return type on its own line above the function name (c-best-practices).
+# AllDefinitions is accepted by both LLVM 18 (Fedora 40) and LLVM 22.
+AlwaysBreakAfterReturnType: AllDefinitions
+
+# Pointer asterisk on the variable: `Token *p_token`, not `Token* p_token`.
+PointerAlignment: Right
+
+# Keep the hand-written include order (own header, system, project).
+SortIncludes: false
+IncludeBlocks: Preserve
+
+# Spacing.
+SpaceBeforeParens: ControlStatements
+SpaceAfterCStyleCast: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+
+# No collapsing short control bodies onto one line.
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortBlocksOnASingleLine: Empty
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortLoopsOnASingleLine: false
+AllowShortEnumsOnASingleLine: false
+
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: Consecutive
+AlignConsecutiveDeclarations: Consecutive
+AlignTrailingComments: true \ No newline at end of file