Commit Graph

188 Commits

Author SHA1 Message Date
Anthony Sottile
7c3404ef1f show color in hook outputs when attached to a tty 2019-10-12 23:17:36 -07:00
Anthony Sottile
2633d38a63 Fix ordering of mixed stdout / stderr printing 2019-10-12 13:35:04 -07:00
Anthony Sottile
f612aeb22b Split out cmd_output_b 2019-10-06 15:16:47 -07:00
Anthony Sottile
a18646deb2 Allow --hook-type to be specified multiple times 2019-09-23 11:14:36 -07:00
Anthony Sottile
f48c0abcbe Use expanduser in init-templatedir like git does 2019-08-03 13:30:13 -07:00
Anthony Sottile
cab8036db3 Don't treat unset init.templateDir as the current directory 2019-08-03 11:55:53 -07:00
Anthony Sottile
1bd9bfefeb Merge pull request #1090 from pre-commit/template_dir
Implement `pre-commit init-templatedir`
2019-07-20 20:56:02 -07:00
Anthony Sottile
9a52eefc99 Implement pre-commit init-templatedir 2019-07-20 20:33:42 -07:00
Anthony Sottile
8be0f857e8 Make autoupdate work for non-master default branches 2019-07-20 15:30:30 -07:00
Anthony Sottile
73250ff4e3 Fix autoupdate to always use non-shallow clone 2019-07-20 14:59:49 -07:00
Michael Adkins
02d95c033c Fixed code style 2019-07-09 13:48:06 -05:00
Michael Adkins
c148845a98 Added hook-stage print to output for missing hook id 2019-07-09 13:06:18 -05:00
Mandar Vaze
3d7b374bef Pass correct value to git color based on args.color 2019-06-01 17:33:27 +05:30
Mandar Vaze
64f0178b75 Pass color option to git diff unconditionally 2019-06-01 07:40:20 +05:30
Mandar Vaze
4f4767c9e0 Pass color option to git diff (on failure)
Fixes #1007
2019-05-31 16:42:16 +05:30
Anthony Sottile
af2c6de9ae Fix double legacy install on windows 2019-04-27 15:10:01 -07:00
Marc Jay
82969e4ba3 Use set rather than list for commit message related stages, remove
default file open modes, tidy up bash call for failing hook test
2019-04-21 21:58:01 +01:00
Marc Jay
e60f541559 Adds support for prepare-commit-msg hooks
Adds a prepare-commit-msg hook stage which allows for hooks which add
dynamic suggested/placeholder text to commit messages that an author can
use as a starting point for writing a commit message
2019-04-21 21:07:13 +01:00
Anthony Sottile
668e6415c0 Adjust messaging slightly 2019-03-30 14:05:24 -07:00
Ben Norquist
71a740d65d add helpful message and test 2019-03-30 14:00:03 -07:00
Artem Polishchuk
9f0cfed600 Specify env python explicitly. 2019-03-30 19:56:52 +02:00
Anthony Sottile
dc28922ccb Run pre-commit autoupdate
Committed via https://github.com/asottile/all-repos
2019-03-21 21:09:33 -07:00
DanielChabrowski
7023caba94 Execute with xargs in try_repo 2019-03-19 20:35:52 +01:00
Anthony Sottile
a18b683d12 Add review suggestion
Co-Authored-By: DanielChabrowski <dantezstudio@gmail.com>
2019-03-18 02:31:47 +01:00
DanielChabrowski
888787fb2d Fix try-repo for staged untracked changes 2019-03-18 02:04:50 +01:00
Jesse Bona
f2be2ead35 Update migrate_config.py
Corrected loop condition to not run if configuration file only contains new lines.
2019-02-02 10:34:53 +11:00
Jesse Bona
7b491c7110 Update migrate_config.py
Added if statement to prevent looping through header lines if configuration file is empty
2019-02-01 19:15:59 +11:00
Anthony Sottile
b1389603e0 Speed up filename filtering.
Before there was a `getcwd` syscall for every filename which was filtered.

Instead this is now cached per-run.

- When all files are identified by filename only: ~45% improvement
- When no files are identified by filename only: ~55% improvement

This makes little difference to overall execution, the bigger win is
eliminating the `memoize_by_cwd` hack.  Just removing the memoization would
have *increased* the runtime by 300-500%.
2019-01-23 20:48:41 -08:00
Anthony Sottile
4f8a9580aa Be more timid about choosing a shebang 2019-01-10 14:26:55 -08:00
Anthony Sottile
bd65d8947f Implement default_stages 2019-01-06 10:32:58 -08:00
Anthony Sottile
d3b5a41830 Implement default_language_version 2019-01-05 13:15:23 -08:00
Anthony Sottile
9e34e6e316 pre-commit gc 2019-01-02 19:07:23 -08:00
Anthony Sottile
bdc58cc33f Teach pre-commit try-repo to clone uncommitted changes 2019-01-01 15:01:36 -08:00
Anthony Sottile
4f9d0397b5 Add more 'no cover windows' comments 2018-12-31 14:06:10 -08:00
Anthony Sottile
c577ed92e7 Refactor pre_commit.repository and factor out cached-property 2018-12-30 20:56:49 -08:00
Pedro Algarvio
8ffd1f69d7 Address review comments 2018-12-27 17:18:11 +00:00
Pedro Algarvio
79c8b1fceb Allow hook alias to be used in SKIP. Includes test. 2018-12-27 12:03:27 +00:00
Pedro Algarvio
5840f880a9 Address review comments and test failures 2018-12-27 12:03:27 +00:00
Pedro Algarvio
b096c0b8f2 Allow aliasing a hook and calling it by it's alias 2018-12-27 12:03:27 +00:00
Anthony Sottile
fe409f1a43 Remove stateful Runner 2018-12-26 22:33:21 -08:00
Anthony Sottile
de942894ff Pick a better python shebang for hook executable 2018-12-25 12:11:02 -08:00
Anthony Sottile
e15d7cde86 Upgrade the sample config 2018-11-15 14:17:10 -08:00
Anthony Sottile
aaa3976a29 Use text_type instead of str() 2018-11-13 17:23:32 -08:00
Milos Pejanovic
e339de22d7 Added requested changes 2018-11-14 01:59:18 +01:00
Milos Pejanovic
bf8c8521cd Added a test and small change for error output 2018-11-14 00:43:04 +01:00
Milos Pejanovic
1c97d3f5fd Added a try except block which reraises InvalidManifestError as RepositoryCannotBeUpdatedError 2018-10-31 17:39:47 +01:00
Anthony Sottile
9f60561d6f Replace resources with importlib_resources 2018-10-14 14:37:35 -07:00
Anthony Sottile
72d10903d5 Update config 2018-08-15 17:55:06 -07:00
Mickaël Schoentgen
67d6fcb0f6 Fix several ResourceWarning: unclosed file 2018-08-10 18:30:22 +02:00
Matt Layman
fd1bc21d8e Use parens instead of different logic pattern. 2018-07-19 23:27:29 -04:00