ruby-saddler icon indicating copy to clipboard operation
ruby-saddler copied to clipboard

Example for Brakeman

Open sanemat opened this issue 10 years ago • 4 comments

Split from #31

I don't find a checkstyle formatter for brakeman, https://github.com/presidentbeef/brakeman/blob/master/OPTIONS.md#output-options

So we can use Saddler::Reporter::Github's PullRequestComment.

brakeman -f text \
| saddler report \
  --reporter Saddler::Reporter::Github::PullRequestComment

We want the converter from brakeman output to checkstyle.

sanemat avatar Sep 18 '15 03:09 sanemat

Please try this.

sanemat avatar Sep 18 '15 03:09 sanemat

@sanemat Brakeman can not use PullRequestReviewComment by 2 reasons. first, ruby-saddler-reporter-github check matching the warned line and the changed line, but brakeman's warning often not match those(like a Attribute Restriction ). second, brakeman not return warning positions(columns).

So, this patch will solution that, but not elegant. I hope update by you better way 😃

m-kubo avatar Mar 14 '17 02:03 m-kubo

I forgot 😅
My usage is below

  git diff -z --name-only \
    | xargs -0 -n999 | tr ' ' ',' \
    | xargs -n999 bundle exec brakeman -f json --only-files \
    | bundle exec brakeman_translate_checkstyle_format translate \
    | bundle exec saddler report --require saddler/reporter/github --reporter Saddler::Reporter::Github::PullRequestReviewComment

brakeman_translate_checkstyle_format is exist!

m-kubo avatar Mar 14 '17 02:03 m-kubo

@m-kubo Awesome!!!!

sanemat avatar Mar 14 '17 02:03 sanemat