Mercurial > hg
annotate contrib/examples/fix.hgrc @ 44008:ac72e17457e5
fix: correct the clang-format example hgrc so that it actually works
There are three changes here:
* Remove -i from `command`, it causes fix to eat your file and empty it out
* Add `set:` to pattern, otherwise this is interpreted as just a glob
* Switch `listfile:` to `include:`; `listfile:` is relative to the current
working directory, while `include:` is relative to the repo root. This makes
it so that you don't receive errors when running outside of the repo root
about being unable to find the file.
Differential Revision: https://phab.mercurial-scm.org/D7618
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 12 Dec 2019 14:28:31 -0800 |
parents | b78795c2a294 |
children | 5e0505d36aee |
rev | line source |
---|---|
42965
5dfb57af1148
contrib: add new examples area and start it out with a config for `hg fix`
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 [fix] |
44008
ac72e17457e5
fix: correct the clang-format example hgrc so that it actually works
Kyle Lippincott <spectral@google.com>
parents:
43921
diff
changeset
|
2 clang-format:command = clang-format --style file |
ac72e17457e5
fix: correct the clang-format example hgrc so that it actually works
Kyle Lippincott <spectral@google.com>
parents:
43921
diff
changeset
|
3 clang-format:pattern = set:(**.c or **.cc or **.h) and not "include:contrib/clang-format-ignorelist" |
42966
f5ad85dd5f7e
examples: add sample fix integration for `rustfmt`
Augie Fackler <augie@google.com>
parents:
42965
diff
changeset
|
4 |
43502
c093cc6e6c99
formatting: remove another data-ogre from the config example
Martin von Zweigbergk <martinvonz@google.com>
parents:
43386
diff
changeset
|
5 rustfmt:command = rustfmt |
42966
f5ad85dd5f7e
examples: add sample fix integration for `rustfmt`
Augie Fackler <augie@google.com>
parents:
42965
diff
changeset
|
6 rustfmt:pattern = set:**.rs |
43065
31c1a5376745
examples: include a sample of how to use black with fix
Augie Fackler <augie@google.com>
parents:
42966
diff
changeset
|
7 |
43351
cb0d80831ee0
contrib: fix up example fix configuration for our move to released black
Augie Fackler <augie@google.com>
parents:
43225
diff
changeset
|
8 black:command = black --config=black.toml - |
43386
2247bf3cec76
fsmonitor: remove pywatchman from exclusion rule
Gregory Szorc <gregory.szorc@gmail.com>
parents:
43351
diff
changeset
|
9 black:pattern = set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" |
43921
b78795c2a294
examples: add an example configuration for go source files
Augie Fackler <augie@google.com>
parents:
43502
diff
changeset
|
10 |
b78795c2a294
examples: add an example configuration for go source files
Augie Fackler <augie@google.com>
parents:
43502
diff
changeset
|
11 # Mercurial doesn't have any Go code, but if we did this is how we |
b78795c2a294
examples: add an example configuration for go source files
Augie Fackler <augie@google.com>
parents:
43502
diff
changeset
|
12 # would configure `hg fix` for Go: |
b78795c2a294
examples: add an example configuration for go source files
Augie Fackler <augie@google.com>
parents:
43502
diff
changeset
|
13 go:command = gofmt |
b78795c2a294
examples: add an example configuration for go source files
Augie Fackler <augie@google.com>
parents:
43502
diff
changeset
|
14 go:pattern = set:**.go |