Comments (6)
Likely it was a regression from the fix of another regression. We've been plagued by different forms of the same problem since 1.63 was released and it seems that every fix creates another problem.
//cc @amomchilov @koic
from rubocop.
Thanks a lot!
from rubocop.
Yea, I thought so yesterday when we faced the 'uninitialized constant Bundler' problem. I hope this helps.
from rubocop.
Oh boy, a fractal of regressions. Sorry for causing this trouble, I had done a pretty through job at manually testing these changes at different times, but there's so many scenarios to consider, and it needs to be retested after even the smallest tweaks.
Is there a way we can add tests to characterize all the various ways that Rubocop can be called? Off the top of my head:
- With a
Gemfile
, running outsidebundler
- With a
Gemfile
, running withbundler
- Without a
Gemfile
, running outsidebundler
- Without a
Gemfile
, running withbundler
As for what OP is describing here, I think the correct approach would be to always try to require "bundler/lockfile_parser"
whenever possible. However, this file can't be required on its own, and needs a bunch of supporting files. Which files are needed, and what order they need to be required in, is completely implementation dependant. This is why I ended up just doing require "bundler"
, but that's didn't work because of the side-effects that causes. (Update, not true! See my comment below)
from rubocop.
Interestingly, the Bundler docs confirm the idea that it can be used "as a library":
# As a standard library inside project, Bundler could be used for introspection
# of loaded and required modules.
from rubocop.
OOOOOHHHHHHhhhhhh. The issue isn't with require "Bundler"
. That always succeeds, even in a folder without a Gemfile(.lock)
.
The issue in #12846 was from trying to call Bundler.default_lockfile
outside of a context that has a lockfile. See #12846 (comment) for details.
I think a simple rescue Bundler::GemfileNotFound
can fix this. I've opened a PR, but will need assistance from others to test and merge it. #12866
from rubocop.
Related Issues (20)
- Inconsistent `Style/ArgumentsForwarding` `...` forwarding behavior
- Enhancement: detect safe navigation in `Style/ReturnNilInPredicateMethodDefinition`
- "Style/MapIntoArray" false positive with push(*ary) HOT 2
- RuboCop spaces -> tab indentation generates overly indented output. HOT 6
- Cop idea: detect redundant setting to empty string inside string interpolation
- Sponsorship logo missing from README HOT 1
- Cops restricted by `Include` are not run when linting a single file HOT 1
- Style/Alias generates invalid code
- issue occur again and again HOT 1
- [Documentation] FAQ, in particular a "usage FAQ" and rubocop-quickref HOT 1
- Style/SymbolProc auto fix brakes logic HOT 3
- Style/RedundantCondition breaks code HOT 1
- Cop idea: lint for inconsistent safe navigation
- Style/CombinableLoops triggered incorrectly
- Style/RedundantLineContinuation: false positive HOT 2
- Ability to ignore branches repeated only by `else` in `Lint/DuplicateBranch` HOT 3
- Layout/FirstHashElementIndentation in `if`
- Crash in a custom ruby extractor brings whole of RuboCop down
- Naming/AccessorMethodName could be more tunable HOT 3
- CodeLength undefined method `to_sym' for false HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubocop.