-
Notifications
You must be signed in to change notification settings - Fork 24
Added AST dumping. #193
Added AST dumping. #193
Conversation
Add ast_dump:true to your .codeclimate.yml file's config. Running codeclimate will now output the AST to stderr, allowing you to figure out filter patterns for issues you don't care about. See README.md for more details.
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.
Just a few minor style changes - this looks great! The documentation is really good as well
lib/cc/engine/analyzers/reporter.rb
Outdated
@@ -93,8 +133,13 @@ def flay_options | |||
CCFlay.default_options.merge changes | |||
end | |||
|
|||
def debug(message) | |||
$stderr.puts(message) if engine_config.debug? | |||
require "thread" |
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.
Can you move this require to the top of the file?
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.
Oops. It was actually already required (tho not sure why?). I also moved the constant up for clarity.
lib/cc/engine/analyzers/reporter.rb
Outdated
def debug(message) | ||
$stderr.puts(message) if engine_config.debug? | ||
require "thread" | ||
IO_M = Mutex.new |
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.
Can you move this constant declaration to the top of the class above def initialize
?
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.
done
lib/cc/engine/analyzers/reporter.rb
Outdated
|
||
process_files | ||
|
||
return dump_ast if engine_config.dump_ast? |
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.
💄 small formatting request:
if engine_config.dump_ast?
dump_ast
else
report
debug("Reported #{reports.size} violations...")
end
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.
Hah! I picked up that style from rubocop. Sure. I can change it to something more conventional.
This is up to date w/ the review now. |
Removes filter extension from CCFlay.
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.
LGTM once green
* Added AST dumping. Add ast_dump:true to your .codeclimate.yml file's config. Running codeclimate will now output the AST to stderr, allowing you to figure out filter patterns for issues you don't care about. See README.md for more details. * Style changes per review. * Bumped to flay 2.10+ and ruby_parser 3.10+. Removes filter extension from CCFlay.
Add ast_dump:true to your .codeclimate.yml file's config.
Running codeclimate will now output the AST to stderr, allowing you to
figure out filter patterns for issues you don't care about.
See README.md for more details.