Skip to content
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

Brakeman #440

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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