Skip to content

Commit

Permalink
Merge pull request #1678 from kasium/issue-1676
Browse files Browse the repository at this point in the history
Document off-by-default feature
  • Loading branch information
asottile committed Sep 4, 2022
2 parents d1939cb + e299674 commit a81fdd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/source/plugin-development/registering-plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion docs/source/user/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a81fdd4

Please sign in to comment.