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

Adds JSON output format #402

Merged
merged 1 commit into from Mar 3, 2015

Conversation

Projects
None yet
4 participants
@leonelgalan
Contributor

leonelgalan commented Mar 2, 2015

Includes both rspec and cucumber tests as seen on the yaml report.


I needed JSON output while setting up a CI with Reek. I was using the YamlReport and YAML.parse(output).to_ruby to get a Hash, but I thought this could be useful for others as well.

I'm getting some 1 failure on rspec and 1 on cucumber, but they are not related to the files changed on this PR. I'm getting the same failures when pulling from master. Maybe is something on my local setup, so I thought I'll give this a try.

@mvz

This comment has been minimized.

Collaborator

mvz commented Mar 3, 2015

Very useful. Looks good to me.

require 'reek/cli/report/formatter'
include Reek
include Reek::Cli

This comment has been minimized.

@troessner

troessner Mar 3, 2015

Owner

I know we are doing this a lot in our codebase but at least for new specs, lets not do the "include Reek" dance and use fully qualified constants.

@troessner

This comment has been minimized.

Owner

troessner commented Mar 3, 2015

Excellent addition!
Lets fix this one thing i commented on and re-squash - then i'll happily merge..;)

@@ -102,6 +103,15 @@ def show
end
#
# Displays a list of smells in JSON format
# JSON with empty array for 0 smells
class JsonReport < Base

This comment has been minimized.

@chastell

chastell Mar 3, 2015

Collaborator

Does it have to be JsonReport rather than JSONReport?

(The only reason for these capitalisation abominations I heard about was related to Rails’ code autoloading, but I’m working on a Rails 2.3 app at the moment and even it would find JSONRerport in json_report.rb just fine.)

Adds JSON output format
Includes both rspec and cucumber tests as seen on the yaml report.
@leonelgalan

This comment has been minimized.

Contributor

leonelgalan commented Mar 3, 2015

Fixed and squashed! Thanks again for building Reek!

@chastell, I feel you but we the same applies to Yaml, Html, Cli, etc. It might require a major refactor to change all this and add consistency across the project.

@troessner

This comment has been minimized.

Owner

troessner commented Mar 3, 2015

Great job, merged, thanks!

troessner pushed a commit that referenced this pull request Mar 3, 2015

Timo Rößner

@troessner troessner merged commit a532f99 into troessner:master Mar 3, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@chastell

This comment has been minimized.

Collaborator

chastell commented Mar 3, 2015

@chastell, I feel you but we the same applies to Yaml, Html, Cli, etc. It might require a major refactor to change all this and add consistency across the project.

Challenge accepted. :bowtie:

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