@@ -61,24 +61,30 @@ Configuration follows the rest of Git configuration, example `~/.gitconfig`:
6161 ignore = site-packages/*, *.sh
6262
6363[fmt-diff "=python "]
64- ignore = true
64+ ignore = true # ignoring all Python files
6565
6666[fmt-diff "=go "]
6767 formatter = gofmt
68+ # ^-- a program from $PATH
6869
6970[fmt-diff "tests/* "]
70- ignore = true
71+ ignore = true # don't check files under tests/ dir
7172
7273[fmt-diff "extern/* "]
73- ignore = true
74+ ignore = true # ignore all files under extern/ dir ...
7475
7576[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
7882
7983[fmt-diff "extern/cpp_lib/*.h "]
8084 ignore = false
8185 filetype = cpp
86+ formatter = ../ParentProj/.bin/astyle --indent=tab -A5
87+ # ^-- relative path to executable
8288
8389# ... [alias], [include] etc. ...
8490```
@@ -97,3 +103,10 @@ Configuration follows the rest of Git configuration, example `~/.gitconfig`:
97103
98104Your formatter command needs to read from stdio and write to stdout.
99105That 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