Config
docstring_format_checker.config
🔗
Summary
Configuration handling for the docstring format checker.
GlobalConfig
dataclass
🔗
Summary
Global configuration for docstring checking behavior.
Source code in src/docstring_format_checker/config.py
107 108 109 110 111 112 113 114 115 116 117 | |
SectionConfig
dataclass
🔗
Summary
Configuration for a docstring section.
Source code in src/docstring_format_checker/config.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
__init__
🔗
__init__(
order: int,
name: str,
type: Literal[
"free_text",
"list_name",
"list_type",
"list_name_and_type",
],
admonition: Union[bool, str] = False,
prefix: str = "",
required: bool = False,
message: str = "",
) -> None
type
instance-attribute
🔗
type: Literal[
"free_text",
"list_name",
"list_type",
"list_name_and_type",
]
__post_init__
🔗
__post_init__() -> None
Summary
Validate configuration after initialization.
Source code in src/docstring_format_checker/config.py
140 141 142 143 144 145 146 | |
Config
dataclass
🔗
Summary
Complete configuration containing global settings and section definitions.
Source code in src/docstring_format_checker/config.py
230 231 232 233 234 235 236 237 238 | |
DEFAULT_CONFIG
module-attribute
🔗
DEFAULT_CONFIG: Config = Config(
global_config=GlobalConfig(), sections=DEFAULT_SECTIONS
)
load_config
🔗
load_config(
config_path: Optional[Union[str, Path]] = None,
) -> Config
Summary
Load configuration from a TOML file or return default configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
Optional[Union[str, Path]]
|
Path to the TOML configuration file.
If |
None
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the specified config file doesn't exist. |
InvalidConfigError
|
If the configuration is invalid. |
Returns:
| Type | Description |
|---|---|
Config
|
Configuration object containing global settings and section definitions. |
Source code in src/docstring_format_checker/config.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
find_config_file
🔗
find_config_file(
start_path: Optional[Path] = None,
) -> Optional[Path]
Summary
Find configuration file by searching up the directory tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_path
|
Optional[Path]
|
Directory to start searching from.
If |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Path]
|
Path to the configuration file if found, None otherwise. |
Source code in src/docstring_format_checker/config.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | |