Git Product home page Git Product logo

Comments (6)

bbatsov avatar bbatsov commented on September 26, 2024 2

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.

AmShaegar13 avatar AmShaegar13 commented on September 26, 2024 1

Thanks a lot!

from rubocop.

AmShaegar13 avatar AmShaegar13 commented on September 26, 2024

Yea, I thought so yesterday when we faced the 'uninitialized constant Bundler' problem. I hope this helps.

from rubocop.

amomchilov avatar amomchilov commented on September 26, 2024

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:

  1. With a Gemfile, running outside bundler
  2. With a Gemfile, running with bundler
  3. Without a Gemfile, running outside bundler
  4. Without a Gemfile, running with bundler

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.

amomchilov avatar amomchilov commented on September 26, 2024

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.

amomchilov avatar amomchilov commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.