From a9768b2a5afeea63be7f9797f541096c91e15ac8 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Mon, 17 May 2021 18:10:23 -0700 Subject: [PATCH] Add helpful comment I ran across this comment on an old PR while researching https://github.com/dependabot/dependabot-core/pull/3590/. The comment seems very useful/easy to overlook, so thought I should add it here. --- .../lib/dependabot/go_modules/file_updater/go_mod_updater.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go_modules/lib/dependabot/go_modules/file_updater/go_mod_updater.rb b/go_modules/lib/dependabot/go_modules/file_updater/go_mod_updater.rb index 5ce05560a3..937b37ac67 100644 --- a/go_modules/lib/dependabot/go_modules/file_updater/go_mod_updater.rb +++ b/go_modules/lib/dependabot/go_modules/file_updater/go_mod_updater.rb @@ -101,6 +101,8 @@ def update_files # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity # If we stubbed modules, don't run `go mod {tidy,vendor}` as # dependencies are incomplete if substitutions.empty? + # go mod tidy should run before go mod vendor to ensure any + # dependencies removed by go mod tidy are also removed from vendors. run_go_mod_tidy run_go_vendor else