diff options
| author | Janosh Riebesell <janosh.riebesell@gmail.com> | 2020-08-20 18:44:57 +0000 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2020-08-21 18:12:19 -0700 |
| commit | d07913288314e9ab2ddaacd73270f703369c8caa (patch) | |
| tree | cc7574b62b0ea6da8b3cb44033dafb2fa4d58f7d /docs/source/user | |
| parent | e897cfac394c9066fc48b2fc120ed03507c97187 (diff) | |
| download | flake8-d07913288314e9ab2ddaacd73270f703369c8caa.tar.gz | |
add note to configuration.rst that inline comments are not supported
Diffstat (limited to 'docs/source/user')
| -rw-r--r-- | docs/source/user/configuration.rst | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/source/user/configuration.rst b/docs/source/user/configuration.rst index 108dd98..4c53877 100644 --- a/docs/source/user/configuration.rst +++ b/docs/source/user/configuration.rst @@ -141,7 +141,7 @@ In our case, if we wanted to, we could also do dist max-complexity = 10 -This would allow us to add comments for why we're excluding items, e.g., +This allows us to add comments for why we're excluding items, e.g. .. code-block:: ini @@ -164,6 +164,26 @@ This would allow us to add comments for why we're excluding items, e.g., .. note:: + Following the recommended settings for `Python's ``configparser`` <https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour>`__, |Flake8| does not support inline comments for any of the keys. So while this is fine: + + .. code-block:: ini + + [flake8] + per-file-ignores = + # imported but unused + __init__.py: F401 + + this is not: + + .. code-block:: ini + + [flake8] + per-file-ignores = + __init__.py: F401 # imported but unused + + +.. note:: + If you're using Python 2, you will notice that we download the :mod:`configparser` backport from PyPI. That backport enables us to support this behaviour on all supported versions of Python. |
