Document how to use in a Git pre-commit hook.

This commit is contained in:
Amy Boyd
2016-12-22 14:23:43 +00:00
parent 167a87e60d
commit 472aaeae1b
2 changed files with 12 additions and 5 deletions

View File

@@ -37,6 +37,18 @@ needed!
* It's super fast. The `check` command finishes small codebases in well under 1 second, and a 250k * It's super fast. The `check` command finishes small codebases in well under 1 second, and a 250k
line codebase is checked in under 3 seconds. line codebase is checked in under 3 seconds.
Use in a Git pre-commit hook
----------------------------
```
editorconfig-cli check src/ tests/
if [[ $? != '0' ]]; then
echo 'Code is not aligned with .editorconfig'
echo 'Review the output and commit your fixes'
exit 1
fi
```
How to contribute How to contribute
----------------- -----------------

View File

@@ -8,8 +8,3 @@
* The file pattern `{num1..num2}` is not fully implemented yet. See * The file pattern `{num1..num2}` is not fully implemented yet. See
`ConvertWildcardPatternToGoRegexp` in `path_matcher.go` `ConvertWildcardPatternToGoRegexp` in `path_matcher.go`
* Add an example of how to use the `check` command in a continuous integration build or in a Git
pre-commit hook.