Show warnings for un-used `noqa` comments

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start by locating pycodestyle's noqa handling in its single Python file and reviewing any existing warning tests. Determine how an unused noqa comment should be identified and reported, then add coverage showing the warning for a comment without a corresponding error.

Written by the indexing model from the issue text.

Description

I did a brief search and couldn't find an issue for this.

There are cases where a noqa comment ends up left in the codebase when it is no longer needed. It would be very nice if a warning could be issued when there is a noqa statement present on a line that doesn't have the corresponding error.

Dominant language
Python
Stars
5.2k
Forks
765
Avg merge
1d 20h
Merged PRs (30d)
1

Getting set up

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.

More from PyCQA/pycodestyle

All issues in PyCQA/pycodestyle

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.