mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #174 from bukzor/buck-172-error-clobbering
fix error clobbering
This commit is contained in:
commit
7119acdc7d
2 changed files with 8 additions and 5 deletions
|
|
@ -44,14 +44,14 @@ def get_validator(
|
|||
obj = load_strategy(file_contents)
|
||||
except Exception as e:
|
||||
raise exception_type(
|
||||
'File {0} is not a valid yaml file'.format(filename), e,
|
||||
'Invalid yaml: {0}\n{1}'.format(os.path.relpath(filename), e),
|
||||
)
|
||||
|
||||
try:
|
||||
jsonschema.validate(obj, json_schema)
|
||||
except jsonschema.exceptions.ValidationError as e:
|
||||
raise exception_type(
|
||||
'File {0} is not a valid file'.format(filename), e,
|
||||
'Invalid content: {0}\n{1}'.format(os.path.relpath(filename), e),
|
||||
)
|
||||
|
||||
obj = apply_defaults(obj, json_schema)
|
||||
|
|
|
|||
3
tox.ini
3
tox.ini
|
|
@ -23,3 +23,6 @@ deps =
|
|||
sphinx
|
||||
changedir = docs
|
||||
commands = sphinx-build -b html -d build/doctrees source build/html
|
||||
|
||||
[flake8]
|
||||
max-line-length=131
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue