openstack-doc-tool's jsoncheck and doctest are inconsistent

Bug #1403159 reported by Adam Gandelman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Fix Released
Critical
Roger Luethi

Bug Description

In a bit of a wedge attempting to update trove's api docs to pass its check-niceness test.

The openstack-jsoncheck's standards differ from openstack-doc-test's with regards to newlines at the end of json files.

Given the following json blob:

TEST_JSON = """
{
    "test": {
        "foo": "bar"
    }
}
"""

openstack-jsoncheck fails, claiming reformatting is required. Doing so using 'openstack-jsoncheck -f fix' results in:

TEST_JSON = """
{
    "test": {
        "foo": "bar"
    }
}"""

Running this fixed file through openstack-doctest's niceness check results in failure: last line of a file must end with a \n

Revision history for this message
Roger Luethi (rl-o) wrote :

It is a bug in jsoncheck.py.

Changed in openstack-manuals:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-doc-tools (master)

Fix proposed to branch: master
Review: https://review.openstack.org/142219

Changed in openstack-manuals:
assignee: nobody → Roger Luethi (rl-o)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-doc-tools (master)

Reviewed: https://review.openstack.org/142219
Committed: https://git.openstack.org/cgit/openstack/openstack-doc-tools/commit/?id=e77e51365b563fefd7a0eb6a15b6bcf79160e755
Submitter: Jenkins
Branch: master

commit e77e51365b563fefd7a0eb6a15b6bcf79160e755
Author: Roger Luethi <email address hidden>
Date: Tue Dec 16 21:39:10 2014 +0100

    Add final newline to file formatting

    The JSON formatting created by jsoncheck.py omits the file's final
    newline. It claims that files with such a newline need reformatting
    and removes the final newline in a file when reformatting.

    This patch brings jsoncheck.py in line with the rest of the tools
    which prefer text files to end with a newline.

    Update release notes for pushing out the bug fix.

    Closes-Bug: #1403159
    Change-Id: I35eab544b183c05b167ce9917d92f0f1f919b745

Changed in openstack-manuals:
status: In Progress → Fix Released
Changed in openstack-manuals:
importance: Undecided → Critical
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.