PyCQA / PyCQA/pycodestyle

W292: error message gets shown three times

Open
#948 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.2k
Forks
754
PR merge metrics
No merged PRs in 30d

Description

While preparing a code snippet for #947 I encountered another bug

test.py

#: does not raise E265

a = print  #: neither raises E265

#raises

=>

❯ pycodestyle test.py 
test.py:5:1: E265 block comment should start with '# '
test.py:5:8: W292 no newline at end of file
test.py:5:8: W292 no newline at end of file
test.py:5:8: W292 no newline at end of file

or minimal

#a

=>

❯ pycodestyle test.py 
test.py:1:1: E265 block comment should start with '# '
test.py:1:3: W292 no newline at end of file
test.py:1:3: W292 no newline at end of file
test.py:1:3: W292 no newline at end of file
pycodestyle --version
2.6.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the minimal test.py snippet and pycodestyle 2.6.0 command shown in the issue. Trace the diagnostic output for E265 and W292, then verify that the completed fix reports the W292 warning only once while preserving the E265 result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.