Skip to content

Wrong error line number #9676

@marcreichel

Description

@marcreichel

Bug Report

Subject Details
Rector version 2.3.6

The line number for an error in the Rector report (dry run for example) is wrong. Instead of the actual line number, the line number where the diff starts (so 3 lines above) gets emitted.

This also leads to wrongly placed annotations in the GitHub diff view (when using --output-format github).

Example:

An error (potential refactoring) was detected on line 92, Rector states the file at line 89.

Minimal PHP Code Causing Issue

The line number is not visible within the Rector demo page.

Expected Behaviour

The actual line where the error is should be emitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions