File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ def is_regex_valid(regex):
2121
2222
2323def get_validator (
24- json_schema ,
25- exception_type ,
26- additional_validation_strategy = lambda obj : None ,
24+ json_schema ,
25+ exception_type ,
26+ additional_validation_strategy = lambda obj : None ,
2727):
2828 """Returns a function which will validate a yaml file for correctness
2929
@@ -44,14 +44,14 @@ def validate(filename, load_strategy=yaml.load):
4444 obj = load_strategy (file_contents )
4545 except Exception as e :
4646 raise exception_type (
47- 'File {0} is not a valid yaml file ' .format (filename ), e ,
47+ 'Invalid yaml: {0}\n {1} ' .format (os . path . relpath ( filename ), e ) ,
4848 )
4949
5050 try :
5151 jsonschema .validate (obj , json_schema )
5252 except jsonschema .exceptions .ValidationError as e :
5353 raise exception_type (
54- 'File {0} is not a valid file ' .format (filename ), e ,
54+ 'Invalid content: {0}\n {1} ' .format (os . path . relpath ( filename ), e ) ,
5555 )
5656
5757 obj = apply_defaults (obj , json_schema )
Original file line number Diff line number Diff line change 2323 sphinx
2424changedir = docs
2525commands = sphinx-build -b html -d build/doctrees source build/html
26+
27+ [flake8]
28+ max-line-length =131
You can’t perform that action at this time.
0 commit comments