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
Conversation
Very useful. Looks good to me. |
require 'reek/cli/report/formatter' | ||
|
||
include Reek | ||
include Reek::Cli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Excellent addition! |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.)
Includes both rspec and cucumber tests as seen on the yaml report.
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. |
Great job, merged, thanks! |
Challenge accepted. |
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.