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

Forced Gemfile updates should be Rubocop ready #10

Open
ajacques opened this issue Sep 22, 2017 · 0 comments
Open

Forced Gemfile updates should be Rubocop ready #10

ajacques opened this issue Sep 22, 2017 · 0 comments

Comments

@ajacques
Copy link

Problem Statement

I, along with I'm sure many other developers, leverage Rubocop for static analysis on my Ruby application. Rubocop has the rule Bundler/OrderedGems that enforces gems listed in the Gemfile must be sorted within their respective newline delimited blocks/groups.

I recently just got the security update from deppbot (much appreciated, btw.) but unfortunately the PR failed my CI due to the aforementioned Rubocop rule failing. This prevented me from immediately merging the changing and releasing it, which any security update should be.

This was because deppbot added it directly after a previous gem.
Example: Pull Request

 gem 'unicorn'
+gem 'nokogiri'

To fix this issue, I had to manually pull the branch down, fix the issue, the push it back up to the branch. Not impossible, but adds time to a security incident resolution.

Solution Proposal

To enable this to pass immediately from the pull request, there's two options:

  1. For the last group, alphabetically sort the gems and ensure that the nokogiri gem comes before unicorn.
  2. Add a newline before the added gem. This separates it out into a separate Gemfile group, which would pass the Rubocop rule.

This would enable Rubocop users to immediately merge these updates into their branch.

Regardless, I really appreciate deppbot and the time it saves me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant