A framework for managing and maintaining multi-language pre-commit hooks.
Find a file
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
pre_commit Add tests for _filter_by_types 2018-05-03 11:46:07 +01:00
testing Restore git 1.8 support 2018-03-12 14:36:07 -07:00
tests Add tests for _filter_by_types 2018-05-03 11:46:07 +01:00
.coveragerc Fixup log_file commit 2017-05-08 11:04:07 -07:00
.gitignore Change ignored cache dir for pytest 3.4.0 2018-02-01 11:15:30 -08:00
.pre-commit-config.yaml Ran pre-commit autoupdate. 2018-03-08 22:41:50 -08:00
.pre-commit-hooks.yaml Remove validate_config hook 2017-08-23 14:06:48 -07:00
.travis.yml Simplify cross version tests 2018-01-02 18:34:00 -08:00
appveyor.yml Adhere to XDG specification for cache dir. 2017-09-06 10:00:35 -07:00
CHANGELOG.md v1.8.2 2018-03-17 20:40:02 -07:00
CONTRIBUTING.md https-ify links 2018-01-13 18:17:54 -08:00
get-swift.sh update swift to swift 4 2018-02-24 11:19:13 -08:00
latest-git.sh Restore git 1.8 support 2018-03-12 14:36:07 -07:00
LICENSE MIT 2014-06-05 08:57:40 -07:00
Makefile Factor out bash and activate files 2016-03-25 11:21:50 -07:00
README.md https-ify links 2018-01-13 18:17:54 -08:00
requirements-dev.txt Remove pypy3 workarounds since we don't test pypy3.2 2017-07-09 14:40:30 -07:00
setup.cfg Replace legacy wheel metadata 2018-04-30 09:33:20 -04:00
setup.py v1.8.2 2018-03-17 20:40:02 -07:00
tox.ini Support node on windows with long path hack 2018-01-12 22:31:43 -08:00

Build Status Coverage Status Build status

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

For more information see: https://pre-commit.com/