class RuboCop::Cop::Lint::Syntax

def add_offense_from_diagnostic(diagnostic, ruby_version)

def add_offense_from_diagnostic(diagnostic, ruby_version)
  message =
    "#{diagnostic.message}\n(Using Ruby #{ruby_version} parser; " \
    'configure using `TargetRubyVersion` parameter, under `AllCops`)'
  add_offense(nil,
              location: diagnostic.location,
              message: message,
              severity: diagnostic.level)
end