mirror of
https://github.com/PyCQA/flake8.git
synced 2026-05-06 02:04:26 +00:00
document that contents may appear before/after a noqa comment
This commit is contained in:
parent
b56c88fe65
commit
b3f54c3f12
1 changed files with 11 additions and 0 deletions
|
|
@ -103,6 +103,17 @@ list all of the errors with commas separating them:
|
||||||
Finally, if we have a particularly bad line of code, we can ignore every error
|
Finally, if we have a particularly bad line of code, we can ignore every error
|
||||||
using simply ``# noqa`` with nothing after it.
|
using simply ``# noqa`` with nothing after it.
|
||||||
|
|
||||||
|
Contents before and after the ``# noqa: ...`` portion are ignored so multiple
|
||||||
|
comments may appear on one line. Here are several examples:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
# mypy requires `# type: ignore` to appear first
|
||||||
|
x = 5 # type: ignore # noqa: ABC123
|
||||||
|
|
||||||
|
# can use to add useful user information to a noqa comment
|
||||||
|
y = 6 # noqa: ABC456 # TODO: will fix this later
|
||||||
|
|
||||||
|
|
||||||
Ignoring Entire Files
|
Ignoring Entire Files
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue