Merge branch 'document_before_after' into 'master'

document that contents may appear before/after a noqa comment

Closes #528

See merge request pycqa/flake8!407
This commit is contained in:
Anthony Sottile 2020-01-16 22:58:19 +00:00
commit 6223dd8ab7

View file

@ -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
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
---------------------