@@ -61,24 +61,30 @@ Configuration follows the rest of Git configuration, example `~/.gitconfig`:
61
61
ignore = site-packages/*, *.sh
62
62
63
63
[fmt-diff "=python "]
64
- ignore = true
64
+ ignore = true # ignoring all Python files
65
65
66
66
[fmt-diff "=go "]
67
67
formatter = gofmt
68
+ # ^-- a program from $PATH
68
69
69
70
[fmt-diff "tests/* "]
70
- ignore = true
71
+ ignore = true # don't check files under tests/ dir
71
72
72
73
[fmt-diff "extern/* "]
73
- ignore = true
74
+ ignore = true # ignore all files under extern/ dir ...
74
75
75
76
[fmt-diff "extern/lib/*.c "]
76
- ignore = false
77
- formatter = astyle --indent=tab
77
+ ignore = false # ... but do NOT ignore C files from extern/lib/ dir
78
+
79
+ [fmt-diff "tools/hex/*.c "]
80
+ formatter = ! ARTISTIC_STYLE_OPTIONS= astyle -A3 -K
81
+ # ^-- use sh expression
78
82
79
83
[fmt-diff "extern/cpp_lib/*.h "]
80
84
ignore = false
81
85
filetype = cpp
86
+ formatter = ../ParentProj/.bin/astyle --indent=tab -A5
87
+ # ^-- relative path to executable
82
88
83
89
# ... [alias], [include] etc. ...
84
90
```
@@ -97,3 +103,10 @@ Configuration follows the rest of Git configuration, example `~/.gitconfig`:
97
103
98
104
Your formatter command needs to read from stdio and write to stdout.
99
105
That implies command needing to be filename agnostic!
106
+
107
+ First word in formatter command needs to be an executable (either from `$PATH` or a path to it).
108
+ Before running it, script checks whether it's possible with `[ -x "$(command -v EXE)" ]`.
109
+ You can use _sh_ expression instead if you start the command with `!`.
110
+
111
+ All paths are in relation to repository root.
112
+ Globs in sections are primitive - relative path won't be handled correctly.
0 commit comments