Commit Graph

80 Commits

Author SHA1 Message Date
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
Anthony Sottile
a68c1ab0d2 Add 'types' to the schema 2017-07-02 13:20:39 -07:00
Anthony Sottile
7b6ea994b8 Expose --source and --origin as environment variables 2017-06-27 10:08:16 -07:00
Anthony Sottile
321210d332 Run git diff with --no-ext-diff 2017-06-09 08:34:04 -07:00
Anthony Sottile
e150921c75 Followup to #533, match no files when omitted 2017-06-02 08:39:10 -07:00
Dain Liffman
d731652a22 Fix for #533 2017-05-31 10:09:42 +08: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
840a55bbc3 Fixup log_file commit 2017-05-08 11:04:07 -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
f000241dcb Local repositories clone a blank repo 2017-02-15 15:36:53 -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
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
81d7efa7bb only consider forward diff in changed files 2016-05-25 14:44:59 +05:30
trbs
8f73b321f5 reorder imports 2016-05-10 17:40:11 +02:00
trbs
9c64ce2caf Set up logging handler in autoupdate 2016-05-10 13:47:06 +02:00
Anthony Sottile
82369fd99f Add utility for parsing shebangs and resolving PATH 2016-04-03 22:54:46 -07:00
Anthony Sottile
b7d395410b Implement a simplified xargs in python 2016-03-25 11:21:50 -07:00
Laurent Sigal
a72ca3d68e Less blocking logic 2015-12-22 19:06:31 +00:00
Laurent Sigal
5a08204b8d Allow to simply run a script once - no matter what the changes are 2015-12-22 18:12:08 +00:00
Anthony Sottile
2df1dc9023 Add python3.5, pypy3, and latest git to travis 2015-12-04 14:30:15 -08:00
Joe Bateson
91a547ed61 Output a message when a hook fails due to file modification 2015-11-25 16:27:47 -08:00
Anthony Sottile
4b2f83d11e Fix hooks that apply non-utf8 diffs 2015-11-13 10:08:37 -08:00
Anthony Sottile
a3f78bc165 Fail a hook if it makes modifications. Resolves #285 2015-11-12 15:16:55 -08:00
Anthony Sottile
67ad0d2d8e Remove expected_return_value. Resolves #232 2015-11-12 13:50:29 -08:00
Anthony Sottile
6eb260f774 Fixups and test for pre-commit/pre-commit#277 2015-10-08 19:08:49 -07:00
Anthony Sottile
223f0d4dfb v0.6.0 2015-10-05 07:53:34 -07:00
Barry Steyn
dd73ffd02f Filtering of hooks for commit or push stages 2015-10-05 07:17:20 -07:00
Anthony Sottile
66b1d39c6e Allow arbitrary bytes in output. Resolves #245 2015-07-23 12:59:13 -07:00
Dmitriy Kunitskiy
72b61a81f9 fix for issue 246 2015-07-20 17:25:08 -07:00
Anthony Sottile
53cc2a64c9 Allow unstaged config when running against files or all-files. Resolves #242 2015-06-15 11:25:58 -07:00
Lucas Cimon
3c02a24655 Fixing bug with local hooks that disappeared during autoupdate 2015-06-14 22:30:28 +02:00
Lucas Cimon
b575cb510c Fix #238 : pre-commit autoupdate fails with local hooks 2015-06-02 23:30:06 +02:00
Anthony Sottile
a97cb38b9a Handle when the hooks directory is not there on install. Resolves #234. 2015-05-23 20:02:42 -07:00