Skip to content

Commit

Permalink
Remove broken generate-man option (#6126)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Sassoulas <[email protected]>
  • Loading branch information
DanielNoord and Pierre-Sassoulas authored Apr 2, 2022
1 parent c1ea253 commit 968b513
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 155 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Release date: TBA

Closes #6074

* Removed the broken ``generate-man`` option.

Closes #5283
Closes #1887

* Add new check ``unnecessary-dunder-call`` for unnecessary dunder method calls.

Closes #5936
Expand Down
5 changes: 5 additions & 0 deletions doc/whatsnew/2.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ Other Changes

Closes #5931

* Removed the broken ``generate-man`` option.

Closes #5283
Closes #1887

* The concept of checker priority has been removed.

* The ``set_config_directly`` decorator has been removed.
Expand Down
2 changes: 0 additions & 2 deletions pylint/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
find_default_config_files,
find_pylintrc,
)
from pylint.config.man_help_formatter import _ManHelpFormatter
from pylint.config.option import Option
from pylint.config.option_manager_mixin import OptionsManagerMixIn
from pylint.config.option_parser import OptionParser
Expand All @@ -32,7 +31,6 @@
"ConfigurationMixIn",
"find_default_config_files",
"find_pylintrc",
"_ManHelpFormatter",
"Option",
"OptionsManagerMixIn",
"OptionParser",
Expand Down
121 changes: 0 additions & 121 deletions pylint/config/man_help_formatter.py

This file was deleted.

16 changes: 0 additions & 16 deletions pylint/config/option_manager_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import os
import sys
from pathlib import Path
from types import ModuleType
from typing import Dict, List, Optional, TextIO, Tuple

from pylint import utils
from pylint.config.man_help_formatter import _ManHelpFormatter
from pylint.config.option import Option
from pylint.config.option_parser import OptionParser

Expand Down Expand Up @@ -219,20 +217,6 @@ def generate_config(
)
printed = True

def generate_manpage(
self, pkginfo: ModuleType, section: int = 1, stream: TextIO = sys.stdout
) -> None:
with _patch_optparse():
formatter = _ManHelpFormatter()
formatter.output_level = self._maxlevel
formatter.parser = self.cmdline_parser
print(
formatter.format_head(self.cmdline_parser, pkginfo, section),
file=stream,
)
print(self.cmdline_parser.format_option_help(formatter), file=stream)
print(formatter.format_tail(pkginfo), file=stream)

def load_provider_defaults(self):
"""Initialize configuration using default values."""
for provider in self.options_providers:
Expand Down
17 changes: 1 addition & 16 deletions pylint/lint/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import warnings
from typing import NoReturn, Optional

from pylint import __pkginfo__, config, extensions, interfaces
from pylint import config, extensions, interfaces
from pylint.config.config_initialization import _config_initialization
from pylint.constants import DEFAULT_PYLINT_HOME, OLD_DEFAULT_PYLINT_HOME, full_version
from pylint.lint.pylinter import PyLinter
Expand Down Expand Up @@ -238,16 +238,6 @@ def __init__(
"configuration.",
},
),
(
"generate-man",
{
"action": "callback",
"callback": self.cb_generate_manpage,
"group": "Commands",
"help": "Generate pylint's man page.",
"hide": True,
},
),
(
"errors-only",
{
Expand Down Expand Up @@ -437,11 +427,6 @@ def cb_generate_config(self, *args, **kwargs):
self.linter.generate_config(skipsections=("COMMANDS",))
sys.exit(0)

def cb_generate_manpage(self, *args, **kwargs):
"""Optik callback for sample config file generation."""
self.linter.generate_manpage(__pkginfo__)
sys.exit(0)

def cb_help_message(self, option, optname, value, parser):
"""Optik callback for printing some help about a particular message."""
self.linter.msgs_store.help_message(utils._splitstrip(value))
Expand Down

0 comments on commit 968b513

Please sign in to comment.