Skip to content

Wrong line number for empty-comment message #4009

Closed
@orSolocate

Description

@orSolocate

Steps to reproduce

  1. create a file with empty comment, for instance:
""" test"""
#
  1. run Pylint with the empty-comment extension Add checker for empty comments #3870

    for example in command line with a file named temp.py:

pylint --load-plugins=pylint.extensions.empty_comment temp.py

  1. Watch Pylint output in the console.

Current behavior

You get the following message output:
temp.py:1:0: R2044: Line with empty comment (empty-comment)

with line number 1.

Expected behavior

You would expect line number 2, i.e with output:
temp.py:2:0: R2044: Line with empty comment (empty-comment)

pylint --version output

pylint 2.6.1-dev1
astroid 2.5.0
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]

running on Windows 10 64-bit

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