Skip to content

Commit

Permalink
Document the pre-commit hook modes.
Browse files Browse the repository at this point in the history
Signed-off-by: format 2020.01.12 <github.com/ChrisCummins/format>

[Exported from 4312fc435ec599e42fcd4ef8e5286772ab029d79]
  • Loading branch information
ChrisCummins committed Jan 12, 2020
1 parent 22f2240 commit 1b6df7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/format/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ Features:

* Automated code styling of C/C++, Python, Java, SQL, JavaScript, HTML,
CSS, go, and JSON files.
* Support for `.formatignore` files to mark files to be excluded from
formatting. The syntax of ignore files is similar to `.gitignore`, e.g. a
list of patterns to match, including (recursive) glob expansion, and
patterns beginning with `!` are un-ignored.
* Support for `.formatignore` files to mark files to be excluded from
formatting. The syntax of ignore files is similar to `.gitignore`, e.g. a
list of patterns to match, including (recursive) glob expansion, and
patterns beginning with `!` are un-ignored.
* A `--pre_commit` mode which formats files that have been staged for commit,
and stages changes. The commit is rejected if a partially-staged file is
modified. Enforce the use of pre-commit mode (and add a "Signed off" footer
to commits) by running `--install_pre_commit_hook`.
* Persistent caching of "last modified" timestamps for files to minimize the
amount of work done.
* A process lock which prevents races when multiple formatters are launched
Expand Down
4 changes: 4 additions & 0 deletions tools/format/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
formatting. The syntax of ignore files is similar to `.gitignore`, e.g. a
list of patterns to match, including (recursive) glob expansion, and
patterns beginning with `!` are un-ignored.
* A `--pre_commit` mode which formats files that have been staged for commit,
and stages changes. The commit is rejected if a partially-staged file is
modified. Enforce the use of pre-commit mode (and add a "Signed off" footer
to commits) by running `--install_pre_commit_hook`.
* Persistent caching of "last modified" timestamps for files to minimize the
amount of work done.
* A process lock which prevents races when multiple formatters are launched
Expand Down

0 comments on commit 1b6df7c

Please sign in to comment.