# frozen_string_literal: true

# To retain during kettle-jem templating:
#     kettle-jem:freeze
#     # ... your code
#     kettle-jem:unfreeze
#

# Style tasks run on the latest Ruby; RuboCop-LTS selects the compatibility
# rules for the configured Ruby floor independently from task dependency floors.

gem "reek", "~> 6.5", ">= 6.5.0"

platform :mri do
  gem "appraisal2-rubocop", "~> 1.0", ">= 1.0.0", require: false
  gem "rubocop-gradual", "~> 0.4", ">= 0.4.0"
  gem "rubocop-minitest", "~> 0.40", ">= 0.40.0"
  gem "rubocop-on-rbs", "~> 2.0", ">= 2.0.0"        # ruby >= 3.2.0
  # gem "rubocop", "~> 1.73", ">= 1.73.2" # constrained by standard
  gem "rubocop-packaging", "~> 0.6", ">= 0.6.0"
  gem "standard", "~> 1.56", ">= 1.56.0"

  if ENV.fetch("RUBOCOP_LTS_LOCAL", "false").casecmp("false").zero?
    declared_gems = instance_variable_get(:@dependencies).to_a.map(&:name)
    gem "rubocop-lts", "~> 8.3", ">= 8.3.1" unless declared_gems.include?("rubocop-lts")
    gem "rubocop-lts-rspec", "~> 1.0", ">= 1.0.5" unless declared_gems.include?("rubocop-lts-rspec")
    gem "rubocop-ruby2_2", "~> 3.0", ">= 3.0.5" unless declared_gems.include?("rubocop-ruby2_2")
  else
    eval_gemfile("style_local.gemfile")
  end
end
