diff options
| author | Anthony Sottile <asottile@umich.edu> | 2020-01-16 14:55:23 -0800 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2020-01-16 14:55:23 -0800 |
| commit | b3f54c3f127611161c7175561f8e78302bee5ab0 (patch) | |
| tree | 7ecf5d32baf00cbc49c0481220d0a26990bc3c70 /docs | |
| parent | b56c88fe654af09161a66bf81e00481fa5d2d8c5 (diff) | |
| download | flake8-b3f54c3f127611161c7175561f8e78302bee5ab0.tar.gz | |
document that contents may appear before/after a noqa comment
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/source/user/violations.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/source/user/violations.rst b/docs/source/user/violations.rst index a511bdc..8681276 100644 --- a/docs/source/user/violations.rst +++ b/docs/source/user/violations.rst @@ -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 --------------------- |
