Skip to content

Commit

Permalink
Add debug information
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Aug 15, 2023
1 parent f6d290b commit e168310
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions doc/exts/pylint_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,18 @@ def _write_options_page(options: OptionsDataDict, linter: PyLinter) -> None:
get_rst_title("Standard Checkers", "^"),
]
found_extensions = False

# We can't sort without using a key because if keys are checkers
# then it's impossible to have a checker with the same name spanning
# various class, and it would make pylint plugin code less readable
# by forcing to use a single class / file
for checker_name, checker_options in sorted(
options.items(), key=lambda x: x[1][0].checker
):
sorted_checkers = sorted(options.items(), key=lambda x: x[1][0].checker)
to_print = [
f"({k}, {v[0].checker.__class__} [{' '.join([i.name for i in v])})]"
for k, v in sorted_checkers
]
print("\n".join(to_print))
for checker_name, checker_options in sorted_checkers:
if not found_extensions and checker_options[0].extension:
sections.append(get_rst_title("Extensions", "^"))
found_extensions = True
Expand Down

0 comments on commit e168310

Please sign in to comment.