Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
rubocop-shopify (3.0.2)
lint_roller
rubocop (~> 1.72, >= 1.72.1)
rubocop (~> 1.89)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -63,7 +63,7 @@ GEM
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.21.1)
json (2.21.2)
kramdown (2.5.2)
rexml (>= 3.4.4)
kramdown-parser-gfm (1.1.0)
Expand All @@ -81,7 +81,7 @@ GEM
drb (~> 2.0)
prism (~> 1.5)
parallel (2.1.0)
parser (3.3.11.1)
parser (3.3.12.0)
ast (~> 2.4.1)
racc
pathutil (0.16.2)
Expand All @@ -97,7 +97,7 @@ GEM
regexp_parser (2.12.0)
rexml (3.4.4)
rouge (4.7.0)
rubocop (1.88.2)
rubocop (1.89.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
Expand All @@ -111,7 +111,7 @@ GEM
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-minitest (0.39.1)
rubocop-minitest (0.40.0)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ test: bundle exec rake

commands:
dump-config:
description: Dump the full RuboCop config as a YAML file for testing
desc: Dump the full RuboCop config as a YAML file for testing
run: bundle exec rake config:dump
5 changes: 3 additions & 2 deletions lib/rubocop-shopify.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# frozen_string_literal: true

require "rubocop"
require "rubocop/shopify/version"
require "rubocop/shopify/plugin"

require "rubocop/cop/lint/no_return_in_memoization"
require "rubocop/cop/style/proc_case_when"
RuboCop::Cop::Lint.register_cop :NoReturnInMemoization, "#{__dir__}/rubocop/cop/lint/no_return_in_memoization"
RuboCop::Cop::Style.register_cop :ProcCaseWhen, "#{__dir__}/rubocop/cop/style/proc_case_when"
10 changes: 10 additions & 0 deletions lib/tasks/config.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ namespace :config do
file = "rubocop.yml"
target = args.fetch(:target, "test/fixtures/full_config.yml")

# Reset the default configuration and loaded plugins so that plugins loaded
# as side effects of running tests (e.g. rubocop-minitest's
# AssertOffense#integrate_plugins!) do not leak into the dump. Without this,
# integrate_plugins! injects all installed lint_roller plugins into the
# global default_configuration, and a prior load_file("rubocop.yml") marks
# rubocop-shopify as already loaded so resolve_plugins skips re-injecting it
# after the reset. Both are lazily rebuilt on the next access.
RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, nil)
RuboCop::ConfigLoader.loaded_plugins.clear

file_config = RuboCop::ConfigLoader.load_file(file)
config = RuboCop::ConfigLoader.merge_with_default(file_config, file)
output = config.to_h.to_yaml.gsub(config.base_dir_for_path_parameters, "")
Expand Down
2 changes: 1 addition & 1 deletion rubocop-shopify.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Gem::Specification.new do |s|

s.required_ruby_version = ">= 3.3.0"

s.add_dependency("rubocop", "~> 1.72", ">= 1.72.1")
s.add_dependency("rubocop", "~> 1.89")
s.add_dependency("lint_roller")
end
Loading
Loading