Skip to content

Commit

Permalink
Add callback for rubocop/ast
Browse files Browse the repository at this point in the history
Loading the version first also gives an opportunity for `rubocop/ast` to react.
Removing handling of rubocop-ast <1.0 in gemspec no longer needed
  • Loading branch information
marcandre committed Sep 24, 2020
1 parent b1e1829 commit 661506c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/rubocop.rb
Expand Up @@ -8,12 +8,13 @@
require 'forwardable'
require 'regexp_parser'
require 'unicode/display_width/no_string_ext'

require_relative 'rubocop/version'
require 'rubocop-ast'

require_relative 'rubocop/ast_aliases'
require_relative 'rubocop/ext/regexp_node'

require_relative 'rubocop/version'

require_relative 'rubocop/core_ext/string'
require_relative 'rubocop/ext/processed_source'

Expand Down Expand Up @@ -636,3 +637,4 @@
unless File.exist?("#{__dir__}/../rubocop.gemspec") # Check if we are a gem
RuboCop::ResultCache.rubocop_required_features = $LOADED_FEATURES - before_us
end
RuboCop::AST.rubocop_loaded if RuboCop::AST.respond_to?(:rubocop_loaded)
2 changes: 1 addition & 1 deletion rubocop.gemspec
Expand Up @@ -38,7 +38,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('rainbow', '>= 2.2.2', '< 4.0')
s.add_runtime_dependency('regexp_parser', '>= 1.7')
s.add_runtime_dependency('rexml')
s.add_runtime_dependency('rubocop-ast', '>= 0.5.0', '< 1.0')
s.add_runtime_dependency('rubocop-ast', '>= 0.5.0')
s.add_runtime_dependency('ruby-progressbar', '~> 1.7')
s.add_runtime_dependency('unicode-display_width', '>= 1.4.0', '< 2.0')

Expand Down

0 comments on commit 661506c

Please sign in to comment.