Zander Hill
0649105566
Merge ff66c20c6e into 9a559cd764
2018-05-15 01:16:56 +00:00
Anthony Sottile
b5af5a5b27
Add test for python_venv language
2018-05-12 11:37:13 -07:00
Zander Hill
ff66c20c6e
Fix types bug by using FrozenSet#intersection
...
Fixes a bug where files are not being recognized based on their `types`
using configuration file.
In the case of using `types: ['bash', 'sh', 'shell']` in
pre-commit-config, those filetypes will not be found, resulting in "no
files found" being reported with pre-commit. This persists even when
using --all-files flag.
Intersection produces predictable results in Python 2.7 and 3.x.
2018-05-03 12:19:57 +01:00
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
af93bec4fd
Fix regression: try-repo from relative path
2018-03-17 20:02:06 -07:00
Anthony Sottile
c420741585
Merge pull request #726 from pre-commit/typo
...
Fix typo
2018-03-12 14:55:31 -07:00
Anthony Sottile
96e9d1b758
Restore git 1.8 support
2018-03-12 14:36:07 -07:00
Anthony Sottile
d9d5b1cef1
Fix typo
2018-03-12 14:34:53 -07:00
Anthony Sottile
c6b6d2340e
Merge pull request #716 from tdeo/multiline_pygrep
...
Add multiline mode to pygrep
2018-03-09 09:39:09 -08:00
Thierry Deo
55c74c10d9
Rename option to and improve output
2018-03-08 09:42:32 +01:00
Anthony Sottile
bf5792eb10
Add a manual stage for cli-only interaction
2018-03-07 12:41:25 -08:00
Anthony Sottile
4088f55ee6
Don't need a shell here
2018-03-07 12:18:54 -08:00
Thierry Deo
25c06e6525
Remove encoding dependence
2018-03-07 09:24:56 +01:00
Anthony Sottile
f679983012
Refuse to install with core.hooksPath set
2018-03-03 15:24:14 -08:00
Thierry Deo
3793bc32c0
Fix linters
2018-02-26 15:46:33 +01:00
Thierry Deo
69333fa227
Add multiline mode to pygrep
2018-02-26 10:17:21 +01: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
082c950d8f
Merge pull request #711 from pre-commit/different_additional
...
Each set of additional dependencies gets its own env
2018-02-24 16:19:34 -08:00
Anthony Sottile
f76d3c4f95
Allow autoupdate --repo to be specified multiple times
2018-02-24 15:42:26 -08:00
Anthony Sottile
8abfb37fdf
Merge pull request #712 from pre-commit/dont_write_to_homedir_under_test
...
Don't write to the home directory under test
2018-02-24 15:36:21 -08:00
Anthony Sottile
b827694520
Each set of additional dependencies gets its own env
2018-02-24 15:28:43 -08:00
Anthony Sottile
d7a41d88c3
Don't write to the home directory under test
2018-02-24 14:36:18 -08:00
Anthony Sottile
40fd04aec3
Don't modify user's npmrc under test
2018-02-24 13:50:15 -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
49dc689bf0
Fix legacy commit-msg hooks
2018-01-29 21:47:35 -08:00
Anthony Sottile
4a6fdd4abe
Add test for pushing to unrelated upstream
2018-01-24 09:21:44 -08:00
Anthony Sottile
0f54fedac9
Replace deprecated yield_fixture with fixture
...
Committed via https://github.com/asottile/all-repos
2018-01-21 15:31:17 -08: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
8fb644e7c0
Simplify prefix a bit
2018-01-13 16:08:18 -08:00
Anthony Sottile
6e46d6ae75
Support node on windows with long path hack
2018-01-12 22:31:43 -08:00
Anthony Sottile
b4541d8a5f
Update the versioned node hook test
2018-01-11 22:20:21 -08:00
Anthony Sottile
7d87da8acd
Move PrefixedCommandRunner -> Prefix
2018-01-11 21:41:48 -08:00
Anthony Sottile
4d6efe1943
Merge pull request #680 from pre-commit/local_golang_repos
...
Fix broken local golang repos
2018-01-09 10:23:37 -08:00
Anthony Sottile
40690064f7
Fix broken local golang repos
2018-01-09 09:42:44 -08:00
Anthony Sottile
2255d8484e
Update message for unstaged config in test
2018-01-09 08:15:27 -08:00
Anthony Sottile
a506a1cac1
Simplify cross version tests
2018-01-02 18:34:00 -08:00
Kevin Hock
ab47d08a38
Make regression test that ensures autoupdate foo keeps everything else
2017-11-08 18:04:34 -08:00
Anthony Sottile
fccb4e6935
Minor fixes
2017-11-06 18:14:59 -08:00
Kevin Hock
70e7d9c5c4
Keep original test as is, for real
2017-11-06 18:05:13 -08:00
Kevin Hock
e5b8cb0f70
Keep original test as is
2017-11-06 18:05:03 -08:00
Kevin Hock
4d0c400066
Add repo option to autoupdate
2017-11-06 17:19:06 -08:00
Anthony Sottile
ae5b74ad38
always_run hooks always apply to the repository
2017-11-03 09:30:03 -07:00
Anthony Sottile
e99813f117
Rename check-files-matches-any to check-hooks-apply
2017-11-03 09:18:58 -07:00
Anthony Sottile
56fca92a42
Remove slowtests=false setting
...
It wasn't actually working because of tox, I also don't use this.
2017-11-02 15:48:43 -07:00