diff --git a/common/dependabot-common.gemspec b/common/dependabot-common.gemspec index 1d8ca6fd07a..4b06a56086e 100644 --- a/common/dependabot-common.gemspec +++ b/common/dependabot-common.gemspec @@ -41,7 +41,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rake", "~> 13" spec.add_development_dependency "rspec", "~> 3.8" spec.add_development_dependency "rspec-its", "~> 1.2" - spec.add_development_dependency "rubocop", "~> 1.36.0" + spec.add_development_dependency "rubocop", "~> 1.37.1" spec.add_development_dependency "rubocop-performance", "~> 1.15.0" spec.add_development_dependency "simplecov", "~> 0.21.0" spec.add_development_dependency "simplecov-console", "~> 0.9.1" diff --git a/common/lib/dependabot/errors.rb b/common/lib/dependabot/errors.rb index 625eda6675f..1e3ca67ee6f 100644 --- a/common/lib/dependabot/errors.rb +++ b/common/lib/dependabot/errors.rb @@ -18,7 +18,7 @@ def sanitize_message(message) return message unless message.is_a?(String) path_regex = - Regexp.escape(Utils::BUMP_TMP_DIR_PATH) + "\/" + + Regexp.escape(Utils::BUMP_TMP_DIR_PATH) + "\\/" + Regexp.escape(Utils::BUMP_TMP_FILE_PREFIX) + "[a-zA-Z0-9-]*" message = message.gsub(/#{path_regex}/, "dependabot_tmp_dir").strip diff --git a/common/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb b/common/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb index 71690bb5546..68a85a84531 100644 --- a/common/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb +++ b/common/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb @@ -153,7 +153,7 @@ def build_details_tag(summary:, body:) msg += body msg + "\n" else - "\n\##{summary}\n\n#{body}" + "\n##{summary}\n\n#{body}" end end diff --git a/common/spec/dependabot/pull_request_creator/message_builder/link_and_mention_sanitizer_spec.rb b/common/spec/dependabot/pull_request_creator/message_builder/link_and_mention_sanitizer_spec.rb index 6108d824e16..fb8614d8dbc 100644 --- a/common/spec/dependabot/pull_request_creator/message_builder/link_and_mention_sanitizer_spec.rb +++ b/common/spec/dependabot/pull_request_creator/message_builder/link_and_mention_sanitizer_spec.rb @@ -300,7 +300,7 @@ it do is_expected.to eq( "

{Issue 111}[https://github-redirect.com/dependabot/" \ - "dependabot-core/issues/111\]

\n" + "dependabot-core/issues/111]

\n" ) end end diff --git a/elm/lib/dependabot/elm/version.rb b/elm/lib/dependabot/elm/version.rb index f111dbdae2e..00a86277d2f 100644 --- a/elm/lib/dependabot/elm/version.rb +++ b/elm/lib/dependabot/elm/version.rb @@ -9,7 +9,7 @@ module Dependabot module Elm class Version < Gem::Version - VERSION_PATTERN = "[0-9]+\.[0-9]+\.[0-9]+" + VERSION_PATTERN = "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_PATTERN_REGEX = /\A#{VERSION_PATTERN}\Z/ def self.correct?(version) diff --git a/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb b/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb index f69fb05ef42..418154f71bb 100644 --- a/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb +++ b/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb @@ -210,7 +210,7 @@ it "updates the pin" do expect(prepared_mixfile.content).to include( '{:phoenix, ">= 0", github: "dependabot-fixtures/phoenix", ' \ - "ref: \'v1.2.1\'}" + "ref: 'v1.2.1'}" ) end end diff --git a/python/lib/dependabot/python/file_updater/pip_compile_file_updater.rb b/python/lib/dependabot/python/file_updater/pip_compile_file_updater.rb index 2ac1fe5ef15..c99a2fc126a 100644 --- a/python/lib/dependabot/python/file_updater/pip_compile_file_updater.rb +++ b/python/lib/dependabot/python/file_updater/pip_compile_file_updater.rb @@ -213,7 +213,8 @@ def write_updated_dependency_files end def install_required_python - return if run_command("pyenv versions").include?("\ #{python_version}") + # The leading space is important + return if run_command("pyenv versions").include?(" #{python_version}") run_command("pyenv install -s #{python_version}") run_command("pyenv exec pip install --upgrade pip") diff --git a/python/lib/dependabot/python/update_checker/pip_compile_version_resolver.rb b/python/lib/dependabot/python/update_checker/pip_compile_version_resolver.rb index 2e2b418a1e0..e6deffdbf71 100644 --- a/python/lib/dependabot/python/update_checker/pip_compile_version_resolver.rb +++ b/python/lib/dependabot/python/update_checker/pip_compile_version_resolver.rb @@ -320,7 +320,8 @@ def write_original_manifest_files end def install_required_python - return if run_command("pyenv versions").include?("\ #{python_version}") + # The leading space is important + return if run_command("pyenv versions").include?(" #{python_version}") run_command("pyenv install -s #{python_version}") run_command("pyenv exec pip install --upgrade pip") diff --git a/python/lib/dependabot/python/update_checker/pipenv_version_resolver.rb b/python/lib/dependabot/python/update_checker/pipenv_version_resolver.rb index 9684630b225..4f4be792b22 100644 --- a/python/lib/dependabot/python/update_checker/pipenv_version_resolver.rb +++ b/python/lib/dependabot/python/update_checker/pipenv_version_resolver.rb @@ -320,7 +320,8 @@ def install_required_python nil end - return if run_command("pyenv versions").include?("\ #{python_version}") + # The leading space is important + return if run_command("pyenv versions").include?(" #{python_version}") requirements_path = NativeHelpers.python_requirements_path run_command("pyenv install -s #{python_version}")