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
a9b3ff4d77
Merge pull request #741 from pre-commit/no_need_di
...
Remove unused __popen DI
2018-05-02 12:10:23 -04:00
Anthony Sottile
e55f51fb14
Remove unused __popen DI
2018-05-02 11:25:16 -04:00
Anthony Sottile
520604939a
Merge pull request #740 from pre-commit/all-repos_autofix_all-repos-sed
...
Replace legacy wheel metadata
2018-04-30 07:47:50 -07:00
Anthony Sottile
e4471e4bc8
Replace legacy wheel metadata
...
Committed via https://github.com/asottile/all-repos
2018-04-30 09:33:20 -04:00
Anthony Sottile
834ed0f229
v1.8.2
2018-03-17 20:40:02 -07:00
Anthony Sottile
593e1784cd
Merge pull request #729 from pre-commit/try_repo_relative_path
...
Fix regression: try-repo from relative path
2018-03-17 20:38:30 -07:00
Anthony Sottile
af93bec4fd
Fix regression: try-repo from relative path
2018-03-17 20:02:06 -07:00
Anthony Sottile
fbebd84494
v1.8.1
2018-03-12 15:34:25 -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
d68d023a0a
Merge pull request #724 from pre-commit/git_1_8
...
Restore git 1.8 support
2018-03-12 14:55:21 -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
179f11bdce
Merge pull request #725 from pre-commit/fix_golang
...
Fix go 1.10: no pkg dir
2018-03-12 14:34:12 -07:00
Anthony Sottile
65f001b007
Fix go 1.10: no pkg dir
2018-03-12 14:02:34 -07:00
Anthony Sottile
ae2eac5c08
v1.8.0
2018-03-11 20:19:16 -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
Anthony Sottile
5a98765782
Merge pull request #722 from pre-commit/all-repos_autofix_pre-commit-autoupdate
...
Ran pre-commit autoupdate.
2018-03-09 08:23:40 -08:00
Thierry Deo
55ef3ce960
Address review comments
2018-03-09 09:22:34 +01:00
Anthony Sottile
67c49cd6a4
Ran pre-commit autoupdate.
...
Committed via https://github.com/asottile/all-repos
2018-03-08 22:41:50 -08:00
Thierry Deo
55c74c10d9
Rename option to and improve output
2018-03-08 09:42:32 +01:00
Anthony Sottile
04fd1de755
Merge pull request #721 from pre-commit/all-repos_autofix_all-repos-sed
...
Normalize git urls in pre-commit config
2018-03-07 18:39:42 -08:00
Anthony Sottile
d760c794a6
Normalize git urls in pre-commit config
...
Improves cache performance
Committed via https://github.com/asottile/all-repos
2018-03-07 17:43:33 -08:00
Anthony Sottile
2483cbde36
Merge pull request #720 from pre-commit/manual
...
Add a manual stage for cli-only interaction
2018-03-07 13:15:53 -08: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
19075371fa
Pre-commit compliance
2018-03-07 09:35:08 +01:00
Thierry Deo
25c06e6525
Remove encoding dependence
2018-03-07 09:24:56 +01:00
Anthony Sottile
f76e7b8eb6
v1.7.0
2018-03-03 16:31:58 -08:00
Anthony Sottile
45a0f90261
Merge pull request #718 from pre-commit/core_hookspath
...
Refuse to install with core.hooksPath set
2018-03-03 15:58:53 -08:00
Anthony Sottile
f679983012
Refuse to install with core.hooksPath set
2018-03-03 15:24:14 -08:00
Anthony Sottile
ac3a37d1a0
Merge pull request #717 from pre-commit/nodeenv_clean_src
...
Use --clean-src for nodeenv
2018-03-01 15:12:42 -08:00
Anthony Sottile
2722e16fd8
Use --clean-src for nodeenv
2018-03-01 14:06:48 -08:00
Thierry Deo
3793bc32c0
Fix linters
2018-02-26 15:46:33 +01:00
Thierry Deo
2d57068f49
Remove newlines from file contents
2018-02-26 13:29:40 +01:00
Thierry Deo
69333fa227
Add multiline mode to pygrep
2018-02-26 10:17:21 +01:00
Anthony Sottile
2e6cd2a44c
Merge pull request #715 from pre-commit/rev
...
Migrate sha -> rev
2018-02-25 18:42:39 -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
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
29715c9268
Merge pull request #710 from pre-commit/dont_modify_my_npmrc
...
Don't modify user's npmrc under test
2018-02-24 14:20:19 -08:00
Anthony Sottile
40fd04aec3
Don't modify user's npmrc under test
2018-02-24 13:50:15 -08:00
Anthony Sottile
b20aae4fe2
Merge pull request #709 from theresama/update-swift
...
update swift to swift 4
2018-02-24 11:55:53 -08:00