Zander Hill
29d66f470d
Add tests for _filter_by_types
...
Adds a test for python and bash `types` using identify per interpreter
interpretation.
The python test succeeds with a false positive. The bash test identifies
the bug, where a comparison happens between `tags >= types`.
Tags is the tag list from identify, types is the value passed in from
configuration file as `acceptable types`.
The `tags(List) >= types(FrozenSet)` does a sort comparison of the two sequences
as evidenced by this code sample (which should return True):
```
>>> types = frozenset(['a'])
>>> tags = ['bash']
>>> tags >= types
True
```
Note: In 2.7, I cannot get this to return anything other than True.
Including the empty case:
```
>>> [] > frozenset()
True
```
Which means to me that a list is always >= a frozenset in Python 2.7.
In Python 3.5, I see errors when comparing a List to a FrozenSet. So
thankfully the interpreter is stricter in this case.
```
>>> [] >= frozenset()
TypeError: unorderable types: list() >= frozenset()
```
2018-05-03 11:46:07 +01:00
Anthony Sottile
96e9d1b758
Restore git 1.8 support
2018-03-12 14:36:07 -07:00
Anthony Sottile
f679983012
Refuse to install with core.hooksPath set
2018-03-03 15:24:14 -08:00
Anthony Sottile
5651c66995
Migrate sha -> rev
2018-02-24 20:19:39 -08:00
Anthony Sottile
184e22e81f
Merge pull request #714 from pre-commit/remove_cwd_fn
...
Move cwd() to tests-only
2018-02-24 17:44:45 -08:00
Anthony Sottile
86da772fd2
Merge pull request #713 from pre-commit/update_many_repos
...
Allow autoupdate --repo to be specified multiple times
2018-02-24 17:04:18 -08:00
Anthony Sottile
29033f10ca
Move cwd() to tests-only
2018-02-24 16:44:59 -08:00
Anthony Sottile
f76d3c4f95
Allow autoupdate --repo to be specified multiple times
2018-02-24 15:42:26 -08:00
Anthony Sottile
b827694520
Each set of additional dependencies gets its own env
2018-02-24 15:28:43 -08:00
Anthony Sottile
bdad930d71
Move pre_commit.schema to cfgv library
2018-02-18 15:25:53 -08:00
Anthony Sottile
5c90c1a68f
Rewrite the hook template in python
2018-02-03 22:51:00 -08:00
Bastien Gérard
b319d6f80c
Add a hook option that allows stdout to be printed when exit code is 0 ( #695 )
2018-02-01 12:21:19 +01:00
Anthony Sottile
5a4dc0ce30
https-ify links
...
- A lot of http links loaded fine on https
- pre-commit.com is now loadable on https via cloudflare
2018-01-13 18:17:54 -08:00
Anthony Sottile
d5dcebf671
Deprecate the pcre language
2018-01-13 17:28:19 -08:00
Anthony Sottile
df38e1010b
Remove unused import
2018-01-09 08:49:42 -08:00
Iulian Onofrei
81df782c20
Update unstaged config file error message
2018-01-09 18:10:05 +02:00
Iulian Onofrei
8407b92b18
Replace string literals with constants
2018-01-09 17:51:41 +02:00
Anthony Sottile
029ccc47c8
Invoke git diff without a pager
2018-01-07 20:56:17 -08:00
Kevin Hock
090030447d
Combine blocks
2017-11-08 17:05:34 -08:00
Kevin Hock
dfb058f15f
Edit comment again
2017-11-08 15:55:05 -08:00
Kevin Hock
e4f28a2193
Edit comment
2017-11-08 15:53:08 -08:00
Kevin Hock
54ccb65a09
Add existing repo_config to output_repos
2017-11-08 15:50:04 -08:00
Kevin Hock
4d0c400066
Add repo option to autoupdate
2017-11-06 17:19:06 -08:00
Anthony Sottile
5a8ca2ffbe
Some minor fixups
2017-10-30 09:12:48 -07:00
Anthony Sottile
84b1ba520d
Remove Manifest, no longer a useful abstraction
2017-10-26 16:17:52 -07:00
Anthony Sottile
10912fa03e
Lazily install repositories
2017-10-20 13:04:33 -07:00
Anthony Sottile
2c88791a7f
Add pre-commit try-repo
...
`try-repo` is useful for:
- Trying out a remote hook repository without needing to configure it.
- Testing a hook repository while developing it.
2017-10-07 18:03:52 -07:00
Anthony Sottile
18c9e061d8
Small cleanups
2017-09-30 15:53:44 -07:00
Anthony Sottile
873dd173ce
Use pipes.quote for executable path
2017-09-21 15:16:48 -07:00
Anthony Sottile
ecdc22ce80
Implement global exclude
2017-09-10 15:09:44 -07:00
Anthony Sottile
6af60158ec
Refactor filename collection for hooks
2017-09-09 22:07:27 -07:00
Anthony Sottile
a821172d9d
Remove defaults before checking whether the intelligent rewrite was successful
2017-09-08 14:28:23 -07:00
Anthony Sottile
72e3989350
Revert "Remove remove_defaults -- it wasn't doing anything"
...
This reverts commit ee392275f3 .
2017-09-08 14:22:36 -07:00
Anthony Sottile
898a3ea1bb
Implement fail_fast.
2017-09-08 13:19:00 -07:00
Anthony Sottile
a78f5d5c24
pre-commit migrate-config should not return nonzero when successful
2017-09-07 09:23:36 -07:00
Anthony Sottile
9ff6818270
Merge pull request #602 from pre-commit/xdg_cache_dir
...
Adhere to XDG specification for cache dir.
2017-09-07 08:19:45 -07:00
Anthony Sottile
8f5675d813
Implement pre-commit migrate-config
2017-09-06 10:07:55 -07:00
Anthony Sottile
3e76cdaf25
Enable map configurations (config v2).
2017-09-06 10:01:08 -07:00
Anthony Sottile
0120af56a7
Adhere to XDG specification for cache dir.
2017-09-06 10:00:35 -07:00
Anthony Sottile
6141c419ee
Remove Runner.cmd_runner and Store.cmd_runner
2017-09-05 14:49:31 -07:00
Anthony Sottile
95c3afacda
Config loading uses ordered_load by default
2017-09-05 14:07:27 -07:00
Anthony Sottile
98ca85eef5
Merge pull request #604 from coldnight/master
...
Fix specify config file not work while installing
2017-09-05 10:12:48 -07:00
Anthony Sottile
0815108242
Handle non-ascii filenames from git
2017-09-05 08:10:16 -07:00
wanghui
f9a849abcc
Fix specify config file not work while installing
...
Via `pre-commit install -c .other-config.yaml`
2017-09-05 16:22:54 +08:00
Anthony Sottile
bba711f468
Remove extra newline on error() call
2017-08-23 14:20:44 -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
ee392275f3
Remove remove_defaults -- it wasn't doing anything
2017-08-10 19:09:25 -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