Browse code

Add Value

Robert Cranston authored on 15/10/2022 19:02:09
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,33 @@
1
+#!/bin/sh
2
+set -euC
3
+
4
+cd "$(dirname "$0")/.."
5
+
6
+file="$(basename "$0")"
7
+in_file="include/gltraits.hpp"
8
+out_file="doc/$file.hpp"
9
+tmp_file="doc/$file-tmp.hpp"
10
+
11
+trap 'rm "$tmp_file"' EXIT
12
+
13
+grep -v '^\s*#include' < "$in_file" > "$tmp_file"
14
+
15
+${CPP:-cpp} -DGLM_VERSION "$tmp_file" \
16
+| grep -v '^\s*#' \
17
+| ${CLANG_FORMAT:-clang-format} --style='{
18
+    "ColumnLimit":                               79,
19
+    "IndentWidth":                               4,
20
+    "UseTab":                                    "Never",
21
+    "BreakBeforeBraces":                         "Allman",
22
+    # "AlignAfterOpenBracket":                     "BlockIndent",
23
+    "AlignAfterOpenBracket":                     "AlwaysBreak",
24
+    "PointerAlignment":                          "Middle",
25
+    "BinPackArguments":                          false,
26
+    "BinPackParameters":                         false,
27
+    "AllowAllArgumentsOnNextLine":               false,
28
+    "AllowAllParametersOfDeclarationOnNextLine": false,
29
+    "AlignConsecutiveDeclarations":              true,
30
+    "AlignConsecutiveAssignments":               true,
31
+  }' \
32
+| sed 's/^\S.*;/&\n/' \
33
+>| "$out_file"