dazuma / toys

A configurable command line tool for builds and workflow automation
Other
128 stars 7 forks source link

Unwanted `Gemfile.lock` change #97

Closed AlexWayfer closed 4 years ago

AlexWayfer commented 4 years ago

Hello.

I have a number of tools in a project. And some of them (not all) changes Gemfile.lock. It's not a library, but complete application, so Gemfile.lock is tracked by git, and these changes are annoying.

While I was testing to reduce a reproducing example to its minimum, I was surprised that these changes occur after empty tools calls.

# .toys.rb

include :bundler, static: true

expand :rubocop

tool :console do
    def run
    end
end
> git diff Gemfile.lock

> toys console

> git diff Gemfile.lock
diff --git a/Gemfile.lock b/Gemfile.lock
index 02b1b9c..713ae26 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -219,7 +219,8 @@ DEPENDENCIES
   rubocop-performance
   sequel_migrations_toys
   steam-api!
-  toys
+  toys (= 0.11.3)
+  toys-core (= 0.11.3)
   twitch!
   twitch-chat!
   twitch_oauth2!

> toys rubocop
Inspecting 98 files
..................................................................................................

98 files inspected, no offenses detected

> git diff Gemfile.lock

>

So, it's like toys rubocop removing these changes, and the empty toys console adding. What.

dazuma commented 4 years ago

Yeah, I also encountered this a few days ago. Toys needs to add itself to the bundle, but that causes bundler to update the lockfile. I think I can get the bundler integration code to revert changes to the lockfile after it runs.