Skip to content

Lineno gets shifted if rst_prolog is present #1349

Description

@MaximilianSoerenPollak

I have encountered a bug where the lineno options inside the NeedsInfoType is offset if there is an rst_prolog specified that isn't empty.
The offset seems to be exactly the lines of the rst_prolog + 1.

A quick fix if you need it (for example in location of warnigns) is to count the rst_prolog newlines add 1 and subtract that from the lineno.
Kind of like this: correct_line_nr = int(need['lineno']) - rst_prolog_len

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions