blueprint modularize-doctest
doctest.py expects to enable syntax checks and formatting checks
individually. This patch changes jsoncheck.py to allow that.
The former boolean "format" argument becomes "formatting", a variable
that can be either "check" or "fix".
A ValueError is thrown if an invalid formatting argument is given to the
function (to be caught by external callers).
Change-Id: If57af0c6f0d46de69c0785635cd57c3a0995654e
blueprint modularize-doctest
The split between process_file (formerly main) and check_format resulted
in a function signature that had three parameters transport four pieces
of information (path indicated whether formatting should take place). The
function used an exception to return a custom warning message when JSON
files were not properly formatted.
This patch merges these two functions and splits out format_parsed_json
instead, which takes one argument and returns formatted JSON. This also
eliminates the FormattingException.
Change-Id: Ia15e862abe181909e4007817c97ceb6ce9e133e7
blueprint modularize-doctest
This patch moves most of the code from checkjson's main into a new
function process_file. External users of the module will have their
own filesystem walker, they just use the module to check/format a file
of interest.
Change-Id: I510b5d3d5ea20d2c0a694ef3401eb9fafc15bed4
Add a new script that can reformat JSON files and check for niceness.
We can use this later as niceness check for openstack-doc-test.
Change-Id: I33c5309bfa2e1abfa6a35d1cfcdc984775e85f05