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

add -noborders flag #46

Merged
merged 3 commits into from
Sep 14, 2020
Merged

add -noborders flag #46

merged 3 commits into from
Sep 14, 2020

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Sep 13, 2020

Make it easier to parse tparse's summary table by
using null rune as table's borders, columns, and
rows' separators.

Make it easier to parse tparse's summary table by
using null rune as table's borders, columns, and
rows' separators.
@mfridman
Copy link
Owner

Question. By "parse" do you mean general look and feel of the output?

Or, would it be useful it tparse outputted the table in JSON format to be further consumed by tools like jq ?


Also, should the test table also output the data in the same manner?

+--------+---------+---------------------------+---------+
| STATUS | ELAPSED |           TEST            | PACKAGE |
+--------+---------+---------------------------+---------+
| PASS   |    0.00 | TestAll                   | log     |
| PASS   |    0.00 | TestOutput                | log     |
| PASS   |    0.00 | TestOutputRace            | log     |
| PASS   |    0.00 | TestFlagAndPrefixSetting  | log     |
| PASS   |    0.00 | TestUTCFlag               | log     |
| PASS   |    0.00 | TestEmptyPrintCreatesLine | log     |
| PASS   |    0.00 | ExampleLogger             | log     |
| PASS   |    0.00 | ExampleLogger_Output      | log     |
+--------+---------+---------------------------+---------+

  STATUS  ELAPSED  PACKAGE  COVER  PASS  FAIL  SKIP  
  PASS    0.19s    log      66.7%     8     0     0  

@alessio
Copy link
Contributor Author

alessio commented Sep 13, 2020

Question. By "parse" do you mean general look and feel of the output?

I meant parseable with basic UNIX tools pipelines (i.e. made of cut, tr, etc).

Or, would it be useful it tparse outputted the table in JSON format to be further consumed by tools like jq ?

I suppose that that is already doable by directly parsing go test -json's output.

Also, should the test table also output the data in the same manner?

Totally, yes. I've made another commit, which should apply the same style to the tests table too 👍

@mfridman
Copy link
Owner

Gotcha. Looks good to me. Thanks for the PR.

Here is what the output looks like now.


  STATUS  ELAPSED            TEST             PACKAGE  
  PASS       0.00  TestAll                    log      
  PASS       0.00  TestOutput                 log      
  PASS       0.00  TestOutputRace             log      
  PASS       0.00  TestFlagAndPrefixSetting   log      
  PASS       0.00  TestUTCFlag                log      
  PASS       0.00  TestEmptyPrintCreatesLine  log      
  PASS       0.00  ExampleLogger              log      
  PASS       0.00  ExampleLogger_Output       log      

  STATUS  ELAPSED  PACKAGE  COVER  PASS  FAIL  SKIP  
  PASS    0.10s    log      66.7%     8     0     0 

@mfridman mfridman merged commit 050d42a into mfridman:master Sep 14, 2020
@alessio alessio deleted the noborders-flag branch September 14, 2020 01:56
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.

2 participants