diff --git a/doc/exts/pylint_options.py b/doc/exts/pylint_options.py index daaa792e98..cc7d1b5a26 100644 --- a/doc/exts/pylint_options.py +++ b/doc/exts/pylint_options.py @@ -98,6 +98,11 @@ def _create_checker_section( checker_table.add(tomlkit.nl()) continue + # Display possible choices + choices = option.optdict.get("choices", "") + if choices: + checker_table.add(tomlkit.comment(f"Possible choices: {choices}")) + # Tomlkit doesn't support regular expressions if isinstance(value, re.Pattern): value = value.pattern diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index 86dd4c32ad..db150ea71c 100644 --- a/doc/user_guide/configuration/all-options.rst +++ b/doc/user_guide/configuration/all-options.rst @@ -538,10 +538,12 @@ Standard Checkers .. code-block:: toml [tool.pylint.basic] + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] argument-naming-style = "snake_case" # argument-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] attr-naming-style = "snake_case" # attr-rgx = @@ -550,24 +552,29 @@ Standard Checkers bad-names-rgxs = [] + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] class-attribute-naming-style = "any" # class-attribute-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] class-const-naming-style = "UPPER_CASE" # class-const-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] class-naming-style = "PascalCase" # class-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] const-naming-style = "UPPER_CASE" # const-rgx = docstring-min-length = -1 + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] function-naming-style = "snake_case" # function-rgx = @@ -578,14 +585,17 @@ Standard Checkers include-naming-hint = false + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] inlinevar-naming-style = "any" # inlinevar-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] method-naming-style = "snake_case" # method-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] module-naming-style = "snake_case" # module-rgx = @@ -600,6 +610,7 @@ Standard Checkers # typevar-rgx = + # Possible choices: ['snake_case', 'camelCase', 'PascalCase', 'UPPER_CASE', 'any'] variable-naming-style = "snake_case" # variable-rgx = @@ -919,6 +930,7 @@ Standard Checkers .. code-block:: toml [tool.pylint.format] + # Possible choices: ['', 'LF', 'CRLF'] expected-line-ending-format = "" ignore-long-lines = "^\\s*(# )??$" @@ -1083,6 +1095,7 @@ Standard Checkers .. code-block:: toml [tool.pylint.logging] + # Possible choices: ['old', 'new'] logging-format-style = "old" logging-modules = ["logging"] @@ -1331,6 +1344,7 @@ Standard Checkers [tool.pylint.spelling] max-spelling-suggestions = 4 + # Possible choices: ['', 'en', 'en_AU', 'en_CA', 'en_GB', 'en_US'] spelling-dict = "" spelling-ignore-comment-directives = "fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:" @@ -1829,6 +1843,7 @@ Extensions accept-no-yields-doc = true + # Possible choices: ['sphinx', 'epytext', 'google', 'numpy', 'default'] default-docstring-type = "default"