Skip to content

Commit

Permalink
[doc] Sort the values for dict based options
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Aug 14, 2023
1 parent 8e908b5 commit c9640fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/exts/pylint_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ def _create_checker_section(
):
value = [i.pattern for i in value]

# Sorting in order for the output to be the same on all interpreters
# Don't sort everything here, alphabetical order do not make a lot of sense
# for options most of the time. Only dict based 'unstable' options need this
if isinstance(value, (list, tuple)) and option.name in ["disable"]:
value = sorted(value, key=lambda x: str(x))

# Add to table
checker_table.add(option.name, value)
checker_table.add(tomlkit.nl())
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/configuration/all-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ Extensions
confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"]
disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "use-symbolic-message-instead", "consider-using-augmented-assign", "prefer-typing-namedtuple"]
disable = ["bad-inline-option", "consider-using-augmented-assign", "deprecated-pragma", "file-ignored", "locally-disabled", "prefer-typing-namedtuple", "raw-checker-failed", "suppressed-message", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "use-symbolic-message-instead", "useless-suppression"]
enable = []
Expand Down

0 comments on commit c9640fe

Please sign in to comment.