main.py 855 B

12345678910111213141516171819202122232425
  1. # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  2. # For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
  3. # Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
  4. """Everything related to the 'pylint-config' command."""
  5. from __future__ import annotations
  6. from typing import TYPE_CHECKING
  7. from pylint.config._pylint_config.generate_command import handle_generate_command
  8. from pylint.config._pylint_config.help_message import get_help
  9. if TYPE_CHECKING:
  10. from pylint.lint.pylinter import PyLinter
  11. def _handle_pylint_config_commands(linter: PyLinter) -> int:
  12. """Handle whichever command is passed to 'pylint-config'."""
  13. if linter.config.config_subcommand == "generate":
  14. return handle_generate_command(linter)
  15. print(get_help(linter._arg_parser))
  16. return 32