107 Commits

Author SHA1 Message Date
Anthony Sottile
0815108242 Handle non-ascii filenames from git 2017-09-05 08:10:16 -07:00
Anthony Sottile
7cb3e00731 Only print that the lock is being acquired when waiting 2017-09-04 11:53:17 -07:00
Anthony Sottile
625aaf54aa Limit repository creation to one process 2017-08-23 20:59:03 -07:00
Anthony Sottile
6793fd8e5d Remove --no-stash and --allow-unstaged-config 2017-08-23 11:16:37 -07:00
Anthony Sottile
469498ac9d Upgrade the sample-config output 2017-08-10 20:45:29 -07:00
Anthony Sottile
59c6df5e46 When possible, preserve config format on autoupdate 2017-08-10 18:32:24 -07:00
Anthony Sottile
d0b268c813 Add support for commit-msg git hook 2017-07-23 20:50:25 -07:00
Anthony Sottile
be3fbdf94e Upgrade add-trailing-comma to 0.4.0 2017-07-15 12:32:36 -07:00
Anthony Sottile
0c70fa4229 Use asottile/add-trailing-comma 2017-07-12 18:30:51 -07:00
Anthony Sottile
a4da7b8c8c Replace calls to touch with open(..., 'a').close() 2017-07-08 15:43:36 -07:00
Anthony Sottile
05a108efe1 Implement exclude_types 2017-07-02 19:08:33 -07:00
Anthony Sottile
a58d99ac40 Implement types filtering 2017-07-02 18:51:23 -07:00
André Berti Sassi
7259135d19 Fix string literal type for Python 3 2017-05-13 20:12:16 -03:00
André Berti Sassi
e774c09fac Add pass_filenames hook option
This option controls whether filenames are passed along as arguments to
the hook program.
2017-05-13 14:28:17 -03:00
Anthony Sottile
964948b33d Fix non-ascii merge commit messages in python2 2017-05-10 12:52:24 -07:00
Alex Hutton
f2644a4f2e Adds support for 'log_file' in hook config
Specify a filename on a per hook basis and
pre-commit will write the STDOUT and STDERR
of that hook into the file. Useful for CI.

Resolves #499.
2017-05-08 10:54:04 +10:00
Anthony Sottile
fa06e72f01 Add a pre-commit sample-config command 2017-03-30 08:45:46 -07:00
Anthony Sottile
cb8dd335f4 Replace jsonschema with better error messages 2017-03-08 14:07:00 -08:00
Anthony Sottile
05c88738b0 Add a --show-diff-on-failure option 2017-02-25 10:14:17 -08:00
Anthony Sottile
7a579af884 Merge pull request #497 from pre-commit/future_versions
Make hook-tmpl resilient to future changes
2017-02-23 16:15:23 -05:00
Anthony Sottile
dbd131f646 Minor fixups 2017-02-23 13:11:40 -08:00
Filippos Giannakos
2f4199850d Add --allow-missing-config option to install
When no '.pre-commit-config.yaml' file exists while `pre-commit` hooks
are enabled, `pre-commit` returns an error and the action is aborted.
This is a very common scenario when pre-commit is added later on a
project and the user wants to work on a previous branch where the
configuration file does not exist.

This commits allow the user to optionally install the `pre-commit` hooks
with an option to allow a missing configuration and trigger only the
legacy pre-commit hooks (if any) when it is missing.
2017-02-23 18:25:51 +02:00
Anthony Sottile
173ce83484 Make hook-tmpl resilient to future changes 2017-02-22 08:48:36 -08:00
Anthony Sottile
8d589a5e97 Make autoupdate slightly more future proof 2017-01-30 18:54:56 -08:00
Anthony Sottile
7e512004d6 Remove pre_commit.ordereddict module 2017-01-30 08:21:34 -08:00
Anthony Sottile
52cd42316c Add a --tags-only option to autoupdate 2017-01-25 21:02:50 -08:00
Anthony Sottile
ba75867c93 py27+ syntax improvements 2017-01-21 11:49:53 -08:00
Anthony Sottile
f238495d6b Add an install-hooks command (similar to install --install-hooks). Resolves #456 2017-01-04 07:52:16 -08:00
Anthony Sottile
0e2c3c1ff9 Merge pull request #441 from alzeih/patch-1
Fix test error "fatal: empty ident name (for <(null)>) not allowed"
2016-12-03 16:47:11 -08:00
alzeih
bdcbdc2e37 Fix test error "fatal: empty ident name (for <(null)>) not allowed"
Occurs when tests run with tox not with Travis CI or Appveyor

Changed existing tox setenv statement to use whitespace around `=` as per
http://tox.readthedocs.io/en/latest/example/basic.html#setting-environment-variables
2016-12-04 13:33:41 +13:00
Jacob Scott
727247e6ed Add tests for alternate config 2016-12-02 16:25:10 -08:00
Jacob Scott
f205e6d170 Incoroporate PR feedback
* Make config_file a required argument to Runner
* Update main.py
* Update tests to make them all green

New test to test alternate config functionality coming in next commit
2016-12-02 13:53:59 -08:00
Anthony Sottile
a7169905dc Centralize logging initialization 2016-11-26 14:19:37 -08:00
Anthony Sottile
0dda19f691 Reorganize output writing 2016-11-26 12:15:55 -08:00
Anthony Sottile
e832ddc57f Merge pull request #408 from pre-commit/no_pyterminalsize
Use 80 or min width instead of terminal size
2016-10-23 16:48:53 -07:00
Anthony Sottile
b81c9802ae Remove py26 format literals
Resolves #403
2016-09-15 08:41:58 -07:00
Anthony Sottile
a677c42e21 Use 80 or min width instead of terminal size 2016-08-31 17:15:52 -07:00
Anthony Sottile
758faa4ae7 Autoupdate to tags when available 2016-06-23 08:29:33 -07:00
Vinay Karanam
b61a0b5467 added test for git forward diff 2016-06-01 15:49:44 +05:30
Anthony Sottile
efe33ffe5c We're not using pylint 2016-05-20 16:14:18 -07:00
Anthony Sottile
82369fd99f Add utility for parsing shebangs and resolving PATH 2016-04-03 22:54:46 -07:00
Anthony Sottile
57638134e3 Make a helper for running pre-commit as a subprocess under test 2016-02-07 13:03:59 -08:00
Anthony Sottile
e2451109f7 norm slashes for windows 2016-02-07 13:03:28 -08:00
Anthony Sottile
982be73784 Add regression test for #339. 2016-02-07 12:33:39 -08:00
Lucas Cimon
941149942d Making it possible to invoke pre-commit run --files some.file from a subdirectory of the repository 2016-02-07 12:25:51 -08:00
Anthony Sottile
2aaaddb5cc Fail gracefully on undecodable install output. 2016-01-12 10:08:59 -08:00
Anthony Sottile
495fefd316 Fix #322 by only removing git environment variables while cloning 2015-12-22 19:10:08 -08:00
Anthony Sottile
4f58f119b1 Add regression test for always_run setting 2015-12-22 12:33:17 -08:00
Anthony Sottile
c3c98afe4f Support pre-commit from inside submodules 2015-12-18 15:35:44 -08:00
Anthony Sottile
be4d0a2742 Add a helper to modify config files under test 2015-12-09 15:12:36 -08:00