mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
This adds missing --- header to yaml file, which is required for strict linting via yamllint. Future versions may add other fixes for yaml files. Fixes: #348
16 lines
376 B
Python
16 lines
376 B
Python
from __future__ import absolute_import
|
|
from __future__ import unicode_literals
|
|
|
|
from pre_commit_hooks import fix_yaml
|
|
|
|
|
|
def test_no_change(tmpdir):
|
|
f = tmpdir.join('f.yaml')
|
|
f.write('---\nfoo: bar')
|
|
assert fix_yaml.main((f.strpath,)) == 0
|
|
|
|
|
|
def test_change(tmpdir):
|
|
f = tmpdir.join('f.yaml')
|
|
f.write('foo: bar')
|
|
assert fix_yaml.main((f.strpath,)) == 1
|