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

Feature/output json string #13

Closed
wants to merge 7 commits into from
Closed

Feature/output json string #13

wants to merge 7 commits into from

Conversation

etagwerker
Copy link
Member

Hey @bleonard,

This is a PR which adds support for a JSON formatter (see #12). I'm not sure what is the preferred/best way to tell rake stats to output JSON instead of a table in the console. Do you have any ideas about that?

Please ignore the test/dummy and all the duplicated code (I had to branch out of #10 to add coverage for this feature)

This set of changes includes a small-ish refactor:

  • It splits up code_statistics.rb into two (calculator calculates, formatter formats output)
  • It adds a superclass for the formatters

Please check it out when you get a minute. It might be easier to review this PR when you merge #10. 😄

Thanks!

… tests by default

Considering there were no tests, I decided to use minitest and set it up to run by default (`bundle exec rake`)

I added a simple test to make sure that `to_s` is working as expected
This commit adds a new formatter (JSON) and it refactors CodeStatistics to coordinate between calculator and formatter.

The goal is to be able to call the rake stats with a parameter that will output the result in JSON format.
@kindoflew kindoflew changed the base branch from master to main September 8, 2021 19:25
@bronzdoc
Copy link
Contributor

@etagwerker I think this needs a rebase

@etagwerker
Copy link
Member Author

@bronzdoc I can do that after #18 is merged. I think that one is more important than this one.

@bronzdoc
Copy link
Contributor

@etagwerker #18 is merged 👍

@etagwerker etagwerker closed this Oct 11, 2021
@etagwerker
Copy link
Member Author

@bronzdoc Closed in favor of #20

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.

Feature: It would be interesting to see the output in machine-readable format (JSON)
2 participants