Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: added new output formats #93

Merged
merged 1 commit into from
Jan 13, 2017
Merged

cmd: added new output formats #93

merged 1 commit into from
Jan 13, 2017

Conversation

ajnavarro
Copy link
Contributor

Now you can change the output format to 2 new ones: json and csv.

  • Added json support
  • Added csv support
  • Now the table output format is called 'pretty'. It is the default format.

@ajnavarro
Copy link
Contributor Author

It Closes #82 and is related to #91

@ajnavarro ajnavarro changed the title cmd: Added new output format cmd: Added new output formats Jan 13, 2017
@ajnavarro ajnavarro requested a review from smola January 13, 2017 11:02
@codecov-io
Copy link

codecov-io commented Jan 13, 2017

Current coverage is 61.31% (diff: 100%)

Merging #93 into master will increase coverage by 1.22%

@@             master        #93   diff @@
==========================================
  Files            36         40     +4   
  Lines          1606       1657    +51   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            965       1016    +51   
  Misses          582        582          
  Partials         59         59          

Powered by Codecov. Last update 0df31d4...c3cc195

@smola smola changed the title cmd: Added new output formats cmd: added new output formats Jan 13, 2017
}
}

func (cf *CsvFormat) Init(headers []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These method names could look more standard:
Init -> WriteHeader
Line -> Write
End -> Close

}

func (cf *JsonFormat) Line(line []interface{}) error {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line

},
}

func TestFormats(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use separate functions for each format so that we have separate test output for them

Now you can change the output format to 2 new ones: json and csv.

- Added json support
- Added csv support
- Now the table output format is called 'pretty'. It is the default format.
@ajnavarro ajnavarro merged commit 48b4a0c into src-d:master Jan 13, 2017
@ajnavarro ajnavarro deleted the feature/output branch January 13, 2017 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants