Document off-by-default feature

Add a short section to the plugin development.

See #1676
This commit is contained in:
Kai Mueller 2022-09-04 15:55:29 +00:00 committed by Anthony Sottile
parent d1939cbafd
commit e299674866
2 changed files with 9 additions and 1 deletions

View file

@ -143,6 +143,12 @@ i.e., ``ABC`` is better than ``A`` but ``ABCD`` is invalid.
*A 3 letters entry point prefix followed by 3 numbers (i.e.* ``ABC123`` *)
is currently the longest allowed entry point name.*
.. _off-by-default:
If your plugin is intended to be opt-in, it can set the attribute
``off_by_default = True``. Users of your plugin will then need to utilize
:ref:`enable-extensions<option-enable-extensions>` with your plugin's entry
point.
.. _Entry Points:
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points

View file

@ -794,11 +794,13 @@ Options and their Descriptions
flake8-typing-extensions
.. _option-enable-extensions:
.. option:: --enable-extensions=<errors>
:ref:`Go back to index <top>`
Enable off-by-default extensions.
Enable :ref:`off-by-default<off-by-default>` extensions.
Plugins to |Flake8| have the option of registering themselves as
off-by-default. These plugins will not be loaded unless enabled by this