Skip to content

Commit e52f4e4

Browse files
[doc all-options] Sort the values for dict based options
1 parent dedb880 commit e52f4e4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/exts/pylint_options.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def _create_checker_section(
133133
):
134134
value = [i.pattern for i in value]
135135

136+
# Sorting in order for the output to be the same on all interpreters
137+
# Don't sort everything here, alphabetical order do not make a lot of sense
138+
# for options most of the time. Only dict based 'unstable' options need this
139+
if isinstance(value, (list, tuple)) and option.name in ["disable"]:
140+
value = sorted(value, key=lambda x: str(x))
141+
136142
# Add to table
137143
checker_table.add(option.name, value)
138144
checker_table.add(tomlkit.nl())

doc/user_guide/configuration/all-options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ Extensions
12071207
12081208
confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"]
12091209
1210-
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"]
1210+
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"]
12111211
12121212
enable = []
12131213

0 commit comments

Comments
 (0)