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.

A noqa for specific warnings/errors per block/line

See original GitHub issue

It would be nice if we could ignore warnings and errors on a per block or per line basis much like # noqa at the end of a line for example.

Use case:

  • Ignore a block of code (a function) that’s considered by mccabe to be “too complex” but you don’t have the time to fix it right now.

<bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1561076-a-noqa-for-specific-warnings-errors-per-block-line?utm_campaign=plugin&utm_content=tracker%2F394650&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F394650&utm_medium=issues&utm_source=github). </bountysource-plugin>

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:8
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

28reactions
Congeecommented, Jun 25, 2019

How can I make flake8 ignore a block of code rather than just by line?

5reactions
gygercommented, Feb 3, 2017

I would suggest the following notation as supported by flake8.

Flake supports to list specific errors only, by using # noqa:<Error No> See here: https://pypi.python.org/pypi/flake8

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flake8: Ignore specific warning for entire file - Stack Overflow
This will ignore these errors across all files. My question was how to ignore particular errors in a single file. – Mark Amery....
Read more >
Ignoring Errors with Flake8 — flake8 3.1.1 documentation
By default, Flake8 has a list of error codes that it ignores. The list used by a version of Flake8 may be different...
Read more >
pylama - Bountysource
It would be nice if we could ignore warnings and errors on a per block or per line basis much like # noqa...
Read more >
Source code for picos.expressions.algebra - GitLab
[docs]@functools.lru_cache() def O(rows=1, cols=1): # noqa """Create a zero matrix. ... from error # Sum all coefficient matrices.
Read more >
Thread: [Docutils-checkins] SF.net SVN - SourceForge
+ Preferably use the `debug`, `info`, `warning`, `error`, or `severe` + ... TODO: why is abs_line_number() == srcline+1 + # if the error...
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