From e299674866aee0946057fbed75711c501c3e686e Mon Sep 17 00:00:00 2001 From: Kai Mueller Date: Sun, 4 Sep 2022 15:55:29 +0000 Subject: [PATCH] Document off-by-default feature Add a short section to the plugin development. See #1676 --- docs/source/plugin-development/registering-plugins.rst | 6 ++++++ docs/source/user/options.rst | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/source/plugin-development/registering-plugins.rst b/docs/source/plugin-development/registering-plugins.rst index 63e279e..ca74008 100644 --- a/docs/source/plugin-development/registering-plugins.rst +++ b/docs/source/plugin-development/registering-plugins.rst @@ -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` with your plugin's entry +point. .. _Entry Points: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points diff --git a/docs/source/user/options.rst b/docs/source/user/options.rst index d9f1221..170c1e7 100644 --- a/docs/source/user/options.rst +++ b/docs/source/user/options.rst @@ -794,11 +794,13 @@ Options and their Descriptions flake8-typing-extensions +.. _option-enable-extensions: + .. option:: --enable-extensions= :ref:`Go back to index ` - Enable off-by-default extensions. + Enable :ref:`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