question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with `warn_unused_ignores = True`

See original GitHub issue

Running mypy with pre-commit while having warn_unused_ignores = True in mypy.ini seems to give me these errors: some/python/file.py:75: error: unused 'type: ignore' comment

The type: ignore isn’t actually unused and running just mypy some/python/file.py (i.e. without pre-commit) on the command line (with same exact mypy version 0.720) gives no errors whatsoever.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Aug 19, 2020

if you share your setup or repository it’s possible we can help, I’d suggest a whole new issue though as this is off topic here

1reaction
asottilecommented, Aug 19, 2020

it is the current behaviour, this just calls mypy after all

Read more comments on GitHub >

github_iconTop Results From Across the Web

The mypy command line - mypy 0.991 documentation
This flag will make mypy report an error whenever your code uses an unnecessary cast that can safely be removed. --warn-unused-ignores#. This flag...
Read more >
ignoring warning "-Wunused-result" - c++ - Stack Overflow
Cast the return value to void if you really want to ignore it (you probably don't). Fix the actual problem by actually using...
Read more >
Warn about unused Optional.some(()) - Swift Forums
Hi all, Right now, expressions that evaluates to Optional<()>, Optional<Optional<()>>… gets special treatment when it's unused.
Read more >
Warning Options (Using the GNU Compiler Collection (GCC))
Level 1 of -Wformat-truncation enabled by -Wformat employs a conservative approach that warns only about calls to bounded functions whose return value is...
Read more >
Warn-by-default Lints - The rustc book
Unused assignments may signal a mistake or unfinished code. If the variable is never used after being assigned, then the assignment can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found