Adds JSON output format #402
Conversation
Very useful. Looks good to me. |
require 'reek/cli/report/formatter' | ||
|
||
include Reek | ||
include Reek::Cli |
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.
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 |
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.)
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.