pre-commit-hooks: python3.6+

This commit is contained in:
Anthony Sottile 2020-02-05 11:10:42 -08:00
parent 551d1a07b3
commit f5c42a050b
60 changed files with 291 additions and 493 deletions

View file

@ -1,15 +1,10 @@
from __future__ import absolute_import
from __future__ import unicode_literals
import io
from pre_commit_hooks.check_yaml import yaml
def test_readme_contains_all_hooks():
with io.open('README.md', encoding='UTF-8') as f:
with open('README.md', encoding='UTF-8') as f:
readme_contents = f.read()
with io.open('.pre-commit-hooks.yaml', encoding='UTF-8') as f:
with open('.pre-commit-hooks.yaml', encoding='UTF-8') as f:
hooks = yaml.load(f)
for hook in hooks:
assert '`{}`'.format(hook['id']) in readme_contents
assert f'`{hook["id"]}`' in readme_contents