-
Notifications
You must be signed in to change notification settings - Fork 46
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
Request: Remove Gemfile.lock from .gitignore #94
Comments
As this gem supports all ruby versions >= 2.0, fix rubocop version to 0.50 (the last version supporting ruby 2.0). Also fix all auto-correctable and/or superficial cops. Remove `Gemfile.lock` from `.gitignore` (per kamui#94) and commit working lockfile.
As this gem supports all ruby versions >= 2.0, fix rubocop version to 0.50 (the last version supporting ruby 2.0). Also fix all auto-correctable and/or superficial cops. Remove `Gemfile.lock` from `.gitignore` (per kamui#94) and commit working lockfile.
I thought best practice for rubygems was to not checkout the Gemfile.lock file if your project is a rubygem. Here's a stackoverflow on it: https://stackoverflow.com/questions/4151495/should-gemfile-lock-be-included-in-gitignore |
@kamui, hrm. This is from 11 years ago, so I'm thinking it might be outdated. In a gem, the |
The top answer was last edited 2 years ago and a quick Google seems to show that even recently it's not definitive that libraries/gems should check in Gemfile.lock. Most seem to say no, but a few resources/comments seem to say it has pros and cons for gems. For this library, it doesn't seem like it would be important? Retriable has no gem dependencies for users of the gem. The only ones in the gemspec are for running tests against it. |
Hrm. I'll check out what bundler does tomorrow. There has to be a definitive answer here as to if bundler checks that file. Honestly the only reason this is important is because of the difficulty that you run into with robocop. Since this gem supports ruby versions that have been EOLed, this gem can't use the latest robocop, which is the most likely to be installed on a dev's machine. (Robocop no longer supports the minimum ruby version in use here, and the rules change names and options over time.) I made this because when I wanted to open a PR for this gem, I literally had to do a deep dive into robocop's commit history to find the version robocop version that matched this project. Even after installiing that robocop though, it becomes difficult if you keep more than one version because without an accurate The alternative to all this I guess would be to put an exact version in the |
I totally forgot about this, but check out bundler's online documentation on this. Also, this is in the manpage for
|
The update on bundler's docs is like their opinion. They made it after the author of the bundler has moved to other projects. |
Also rubocop is a cancer anyway. This literally shows how it creates excessive problems out of thin air. |
Normally you only add gems you specifically need in your project in Gemfile. Gemfile.lock will have all the dependencies of these gems. So if you want to lock these dependencies versions you must check your Gemfile.lock, otherwise each bundle install / bundle update will update all dependencies and potentially break stuff. |
I believe it is best practices to do so in ruby (as it helps ensure consistent testing/debugging) but it's especially relevant here, as nothing in the
Gemfile
is version locked.An example why this is needed:
I just forked this repository and ran
bundle update
(I couldn't usebundle install
due to the lack of a lockfile), and I am immediately seeingrubocop
erroring out due to the fact two of the cops (Layout/IndentArray
andLayout/IndentHash
) listed in the config have since been renamed.My choices are to either:
a) Guess at the intended version of
rubocop
using the timesgem log .rubocop.yml
, adding the version lock to theGemfile
and re-runningbundle update
, or;b) Update the
.rubocop.yml
.Obviously, either solution requires changes to a file tracked by git, which I would then have to pick around.
The text was updated successfully, but these errors were encountered: