diff --git a/docs/source/user/options.rst b/docs/source/user/options.rst index f9e8b86..8db2df8 100644 --- a/docs/source/user/options.rst +++ b/docs/source/user/options.rst @@ -607,13 +607,14 @@ Options and their Descriptions :ref:`Go back to index ` + **You usually do not need to specify this option as the default includes + all installed plugin codes.** + Specify the list of error codes you wish |Flake8| to report. Similarly to :option:`--ignore`. You can specify a portion of an error code to get all that start with that string. For example, you can use ``E``, ``E4``, ``E43``, and ``E431``. - This defaults to: ``E,F,W,C90`` - Command-line example: .. prompt:: bash @@ -649,6 +650,9 @@ Options and their Descriptions .. versionadded:: 4.0.0 + **You usually do not need to specify this option as the default includes + all installed plugin codes.** + Specify a list of codes to add to the list of selected ones. Similar considerations as in :option:`--select` apply here with regard to the value. diff --git a/src/flake8/defaults.py b/src/flake8/defaults.py index e3edf32..8add695 100644 --- a/src/flake8/defaults.py +++ b/src/flake8/defaults.py @@ -16,7 +16,6 @@ EXCLUDE = ( "*.egg", ) IGNORE = ("E121", "E123", "E126", "E226", "E24", "E704", "W503", "W504") -SELECT = ("E", "F", "W", "C90") MAX_LINE_LENGTH = 79 INDENT_SIZE = 4 diff --git a/src/flake8/main/options.py b/src/flake8/main/options.py index 891bae9..9d57321 100644 --- a/src/flake8/main/options.py +++ b/src/flake8/main/options.py @@ -297,9 +297,11 @@ def register_default_options(option_manager: OptionManager) -> None: parse_from_config=True, comma_separated_list=True, help=( - f"Comma-separated list of error codes to enable. " - f"For example, ``--select=E4,E51,W234``. " - f"(Default: {','.join(defaults.SELECT)})" + "Limit the reported error codes to codes prefix-matched by this " + "list. " + "You usually do not need to specify this option as the default " + "includes all installed plugin codes. " + "For example, ``--select=E4,E51,W234``." ), ) @@ -309,8 +311,10 @@ def register_default_options(option_manager: OptionManager) -> None: parse_from_config=True, comma_separated_list=True, help=( - "Comma-separated list of error codes to add to the list " - "of selected ones. For example, ``--extend-select=E4,E51,W234``." + "Add additional error codes to the default ``--select``. " + "You usually do not need to specify this option as the default " + "includes all installed plugin codes. " + "For example, ``--extend-select=E4,E51,W234``." ), ) diff --git a/src/flake8/style_guide.py b/src/flake8/style_guide.py index 8431650..a409484 100644 --- a/src/flake8/style_guide.py +++ b/src/flake8/style_guide.py @@ -88,7 +88,7 @@ class DecisionEngine: self.selected = _select_ignore( option=options.select, - default=defaults.SELECT, + default=(), extended_default=options.extended_default_select, extend=options.extend_select, ) diff --git a/tests/unit/test_decision_engine.py b/tests/unit/test_decision_engine.py index 27ced3f..d543d5e 100644 --- a/tests/unit/test_decision_engine.py +++ b/tests/unit/test_decision_engine.py @@ -14,7 +14,7 @@ def create_options(**kwargs): kwargs.setdefault("ignore", None) kwargs.setdefault("extend_select", None) kwargs.setdefault("extend_ignore", None) - kwargs.setdefault("extended_default_select", []) + kwargs.setdefault("extended_default_select", ["C90", "F", "E", "W"]) kwargs.setdefault("extended_default_ignore", []) kwargs.setdefault("disable_noqa", False) return argparse.Namespace(**kwargs)