Skip to content

Multiple output formatting #2

Description

@jerbia

Currently batten output format is human readable text with some nice green and red coloring.
We would like to add an option for machine readable formats, like JSON, which can be used for integrations with server spec or other continuous integration systems.

The output format type should be specified in the batten check command line parameters.
If missing, the default human readable output format should be used.

Activity

  1. petersellars commented on Sep 19, 2015

    @petersellars

    @jerbia I am happy to help with this - I made a start on a JSON machine readable experiment here (https://github.com/petersellars/batten) as part of #dockerhackday. I am new to Go, so learning as I go to some extent so would appreciate any code review/feedback.

    My initial thought was to create a JSON representation and add a '--machine-readable' flag to generate this either as a file or instead of the output currently generated.

    Happy to discuss - will work on the JSON representation and let you know how I go.

  2. jandre commented on Sep 20, 2015

    @jandre
    Member

    This would be awesome @petersellars!

    Maybe instead of --machine-readable, you could do a flag like:

     --output-format=[text|json|...]  
    

    This way you could supply different report formats (like html or yaml or whatever) in the future.

  3. jerbia commented on Sep 20, 2015

    @jerbia
    ContributorAuthor

    Hi @petersellars! Welcome on board!

    I'll be happy to review your code and provide feedback. You can submit a pull request when you are done and we can go over your changes.

    As for the parameter name - I agree with @jandre, using "--output-format" will allow
    additional formats in the future.

    Thanks for contributing!

    Amir

  4. petersellars commented on Sep 22, 2015

    @petersellars

    Thanks @jandre and @jerbia - that flag makes sense to me. Had considered yaml as well as json when starting to look at this. I shall continue with the initial json implementation and then submit for review - expect plenty of feedback as new to Go - still learning the Go idioms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions