Class: Rails::Tc::TypeChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/tc/type_checker.rb

Constant Summary collapse

ERROR_LINE_REGEX =
%r{^([^:]+):([0-9]+): (.*) https://srb\.help/([0-9]+)$}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ignored_errors = [], ignored_patterns = []) ⇒ TypeChecker

Returns a new instance of TypeChecker.



15
16
17
18
# File 'lib/rails/tc/type_checker.rb', line 15

def initialize(ignored_errors = [], ignored_patterns = [])
  @ignored_errors = ignored_errors
  @ignored_patterns = ignored_patterns
end

Class Method Details

.set_up?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rails/tc/type_checker.rb', line 11

def self.set_up?
  File.exist?(Rails.root.join("sorbet/config"))
end

Instance Method Details

#errorsObject



20
21
22
# File 'lib/rails/tc/type_checker.rb', line 20

def errors
  @errors ||= run
end