2021-09-15 20:35:30 +00:00
|
|
|
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
|
2022-03-01 15:04:49 +00:00
|
|
|
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
|
2021-09-15 20:35:30 +00:00
|
|
|
|
2022-04-14 07:47:58 +00:00
|
|
|
from __future__ import annotations
|
2021-09-15 20:35:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# This class could and should be replaced with a simple dataclass when support for Python < 3.7 is dropped.
|
|
|
|
# A NamedTuple is not possible as some tests need to modify attributes during the test.
|
|
|
|
class PyreverseConfig: # pylint: disable=too-many-instance-attributes, too-many-arguments
|
|
|
|
"""Holds the configuration options for Pyreverse.
|
2022-03-13 12:15:46 +00:00
|
|
|
|
2022-01-02 22:21:23 +00:00
|
|
|
The default values correspond to the defaults of the options' parser.
|
|
|
|
"""
|
2021-09-15 20:35:30 +00:00
|
|
|
|
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
mode: str = "PUB_ONLY",
|
2022-04-14 07:47:58 +00:00
|
|
|
classes: list[str] | None = None,
|
|
|
|
show_ancestors: int | None = None,
|
|
|
|
all_ancestors: bool | None = None,
|
|
|
|
show_associated: int | None = None,
|
|
|
|
all_associated: bool | None = None,
|
2021-09-15 20:35:30 +00:00
|
|
|
show_builtin: bool = False,
|
2022-04-14 07:47:58 +00:00
|
|
|
module_names: bool | None = None,
|
2021-09-15 20:35:30 +00:00
|
|
|
only_classnames: bool = False,
|
|
|
|
output_format: str = "dot",
|
|
|
|
colorized: bool = False,
|
|
|
|
max_color_depth: int = 2,
|
2022-04-14 07:47:58 +00:00
|
|
|
ignore_list: tuple[str, ...] = tuple(),
|
2021-09-15 20:35:30 +00:00
|
|
|
project: str = "",
|
|
|
|
output_directory: str = "",
|
2021-10-02 14:15:35 +00:00
|
|
|
) -> None:
|
2021-09-15 20:35:30 +00:00
|
|
|
self.mode = mode
|
|
|
|
if classes:
|
|
|
|
self.classes = classes
|
|
|
|
else:
|
|
|
|
self.classes = []
|
|
|
|
self.show_ancestors = show_ancestors
|
|
|
|
self.all_ancestors = all_ancestors
|
|
|
|
self.show_associated = show_associated
|
|
|
|
self.all_associated = all_associated
|
|
|
|
self.show_builtin = show_builtin
|
|
|
|
self.module_names = module_names
|
|
|
|
self.only_classnames = only_classnames
|
|
|
|
self.output_format = output_format
|
|
|
|
self.colorized = colorized
|
|
|
|
self.max_color_depth = max_color_depth
|
|
|
|
self.ignore_list = ignore_list
|
|
|
|
self.project = project
|
|
|
|
self.output_directory = output_directory
|