Skip to content

Commit

Permalink
Handle RuboCop constant name but rubocop file name
Browse files Browse the repository at this point in the history
  • Loading branch information
sambostock committed Oct 27, 2022
1 parent 978f837 commit f30e99f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ class RuboCopSpec < ::DslSpec
.descendants_of(::RuboCop::Cop::Base)
.filter_map { |constant| Runtime::Reflection.name_of(constant) }

class << self
def target_class_file
# Against convention, RuboCop uses "rubocop" in its file names, so we do too.
super.gsub("rubo_cop", "rubocop")
end
end

describe "Tapioca::Dsl::Compilers::RuboCop" do
sig { void }
def before_setup
require "tapioca/dsl/extensions/rubo_cop"
require "tapioca/dsl/extensions/rubocop"
super
end

Expand Down

0 comments on commit f30e99f

Please sign in to comment.