Skip to content

Commit

Permalink
Merge pull request #440 from platanus/brakeman
Browse files Browse the repository at this point in the history
Brakeman
  • Loading branch information
ldlsegovia authored May 23, 2023
2 parents 7c2915a + 4fbf401 commit 416d1cc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
Features
- Add environment variables module recipe [#435](https://github.com/platanus/potassium/pull/435)
- Run [Brakeman](https://brakemanscanner.org/) with reviewdog on CI [#440](https://github.com/platanus/potassium/pull/440)

Fixes
- Fix CircleCI config [#434](https://github.com/platanus/potassium/pull/434)
Expand Down
7 changes: 7 additions & 0 deletions lib/potassium/assets/.circleci/config.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ jobs:
steps:
- setup

- run:
name: Run brakeman
shell: /bin/bash
command: |
bundle exec brakeman --quiet --format tabs --no-exit-on-warn --no-exit-on-error --output "tmp/brakeman_report"; \
./bin/reviewdog < "tmp/brakeman_report" -reporter=github-pr-review -f=brakeman -name="Brakeman"

- run:
name: Get files to lint
command: git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
Expand Down
4 changes: 4 additions & 0 deletions lib/potassium/recipes/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def create
gather_gem 'rspec_junit_formatter', '~> 0.4'
end

gather_gems(:development, :test) do
gather_gem('brakeman')
end

add_readme_header :ci
application 'config.assets.js_compressor = :uglifier', env: 'test'
end
Expand Down
7 changes: 6 additions & 1 deletion spec/features/ci_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
create_dummy_project
end

it "adds brakeman to Gemfile" do
content = IO.read("#{project_path}/Gemfile")
expect(content).to include("brakeman")
end

it "correctly bundles the config file" do
expect(ci_config).to include('cimg/ruby', 'cache', 'rspec', 'reviewdog')
expect(ci_config).to include('cimg/ruby', 'cache', 'rspec', 'reviewdog', 'brakeman')
end

it "uses dasherized app name for repo analyzer" do
Expand Down

0 comments on commit 416d1cc

Please sign in to comment.