lib/rubocop/cop/cop.rb in rubocop-0.77.0 vs lib/rubocop/cop/cop.rb in rubocop-0.78.0
- old
+ new
@@ -170,10 +170,12 @@
nil
end
def disable_uncorrectable(node)
+ return unless node
+
@disabled_lines ||= {}
line = node.location.line
return if @disabled_lines.key?(line)
@disabled_lines[line] = true
@@ -215,10 +217,10 @@
def excluded_file?(file)
!relevant_file?(file)
end
- # This method should be overriden when a cop's behavior depends
+ # This method should be overridden when a cop's behavior depends
# on state that lives outside of these locations:
#
# (1) the file under inspection
# (2) the cop's source code
# (3) the config (eg a .rubocop.yml file)