diff --git a/Gemfile.lock b/Gemfile.lock index 935e0348..b15a0515 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ PATH remote: . specs: - standard (1.35.1) + standard (1.34.0.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.62.0) + rubocop (~> 1.60) standard-custom (~> 1.0.0) standard-performance (~> 1.3) @@ -30,7 +30,7 @@ GEM rake (13.0.6) regexp_parser (2.8.2) rexml (3.2.6) - rubocop (1.62.1) + rubocop (1.60.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -38,11 +38,11 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) rubocop-performance (1.20.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) diff --git a/lib/standard/cli.rb b/lib/standard/cli.rb index 1c00e3cc..b6132189 100644 --- a/lib/standard/cli.rb +++ b/lib/standard/cli.rb @@ -1,5 +1,6 @@ require_relative "builds_config" require_relative "loads_runner" +require_relative "prints_big_hairy_version_warning" module Standard class Cli @@ -10,8 +11,8 @@ def initialize(argv) end def run - config = @builds_config.call(@argv) - @loads_runner.call(config.runner).call(config).to_i + PrintsBigHairyVersionWarning.new.call + exit 1 end end end diff --git a/lib/standard/prints_big_hairy_version_warning.rb b/lib/standard/prints_big_hairy_version_warning.rb new file mode 100644 index 00000000..982106bb --- /dev/null +++ b/lib/standard/prints_big_hairy_version_warning.rb @@ -0,0 +1,45 @@ +module Standard + class PrintsBigHairyVersionWarning + WARNING = <<~MSG.gsub(/^ {6}/, "") + ============================================================================ + = WARNING: You do not want to run this version of Standard! = + ============================================================================ + + What's going on here? + --------------------- + Version 1.34.0 of Standard was set to depend on `~> 1.60' of RuboCop. This + constraint is too loose, and covers all minor versions of RuboCop 1.x. + + "How do I fix this?", you might be asking. + + How to fix this + --------------- + If you add a version specifier pinning `standard' to a version newer + than 1.35.1, Bundler will resolve appropriate versions of `standard', + `rubocop', and any other rubocop-dependent gems you may have installed. + + 1. Update your Gemfile to pin standard to be at least one such version: + + gem "standard", ">= 1.35.1" + + 2. Run `bundle`, which will install and lock more appropriate versions + + Example output: + Using rubocop 1.48.1 (was 1.49.0) + Using standard 1.26.0 (was 0.0.36) + + This version (1.34.0.1) is an inoperative placeholder gem that exists + solely to print this message. + + We're very sorry for this inconvenience! + + ============================================================================ + = END OF BIG SCARY WARNING = + ============================================================================ + MSG + + def call + warn WARNING + end + end +end diff --git a/lib/standard/version.rb b/lib/standard/version.rb index 949922da..20cb353d 100644 --- a/lib/standard/version.rb +++ b/lib/standard/version.rb @@ -1,3 +1,3 @@ module Standard - VERSION = Gem::Version.new("1.35.1") + VERSION = Gem::Version.new("1.34.0.1") end diff --git a/standard.gemspec b/standard.gemspec index 8930a766..3bcae8a4 100644 --- a/standard.gemspec +++ b/standard.gemspec @@ -1,6 +1,7 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "standard/version" +require "standard/prints_big_hairy_version_warning" Gem::Specification.new do |spec| spec.name = "standard" @@ -23,12 +24,14 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.metadata["rubygems_mfa_required"] = "true" - spec.add_dependency "rubocop", "~> 1.62.0" + spec.add_dependency "rubocop", "~> 1.60" spec.add_dependency "lint_roller", "~> 1.0" spec.add_dependency "standard-custom", "~> 1.0.0" spec.add_dependency "standard-performance", "~> 1.3" + spec.post_install_message = Standard::PrintsBigHairyVersionWarning::WARNING + # not semver: first three are lsp protocol version, last is patch spec.add_dependency "language_server-protocol", "~> 3.17.0.2" end