Skip to content

Exception on global Rubocop errors #420

Description

@daniel-rikowski

Whenever erb_lint tries to record a rubocop offense which affects a whole file itself, e.g. Naming/FileName or Lint/EmptyFile,
then ERBLint::ProcessedSource#to_source_range causes a runtime error "undefined method 'begin' for an instance of RuboCop::Cop::Offense::PseudoSourceRange"

This happens because the range argument in such offenses is a RuboCop::Cop::Offense::PseudoSourceRange without a begin or end method.

This is also the root cause for #388

Rubocop background:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions