docstring-format-checker 1.11.2__tar.gz → 1.11.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docstring-format-checker
3
- Version: 1.11.2
3
+ Version: 1.11.3
4
4
  Summary: A CLI tool to check and validate Python docstring formatting and completeness
5
5
  Author: Chris Mahoney
6
6
  Author-email: Chris Mahoney <docstring-format-checker@data-science-extensions.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "docstring-format-checker"
3
- version = "1.11.2"
3
+ version = "1.11.3"
4
4
  description = "A CLI tool to check and validate Python docstring formatting and completeness"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -44,7 +44,7 @@
44
44
 
45
45
  # ## Python StdLib Imports ----
46
46
  import sys
47
- from dataclasses import dataclass
47
+ from dataclasses import dataclass, field
48
48
  from pathlib import Path
49
49
  from typing import Any, Literal, Optional, Union
50
50
 
@@ -111,11 +111,41 @@ class GlobalConfig:
111
111
  Global configuration for docstring checking behavior.
112
112
  """
113
113
 
114
- allow_undefined_sections: bool = False
115
- require_docstrings: bool = True
116
- check_private: bool = False
117
- validate_param_types: bool = True
118
- optional_style: Literal["silent", "validate", "strict"] = "validate"
114
+ allow_undefined_sections: bool = field(
115
+ default=False,
116
+ metadata={
117
+ "title": "Allow Undefined Sections",
118
+ "description": "Allow sections not defined in the configuration.",
119
+ },
120
+ )
121
+ require_docstrings: bool = field(
122
+ default=True,
123
+ metadata={
124
+ "title": "Require Docstrings",
125
+ "description": "Require docstrings for all functions/methods.",
126
+ },
127
+ )
128
+ check_private: bool = field(
129
+ default=False,
130
+ metadata={
131
+ "title": "Check Private Members",
132
+ "description": "Check docstrings for private members (starting with an underscore).",
133
+ },
134
+ )
135
+ validate_param_types: bool = field(
136
+ default=True,
137
+ metadata={
138
+ "title": "Validate Parameter Types",
139
+ "description": "Validate that parameter types are provided in the docstring.",
140
+ },
141
+ )
142
+ optional_style: Literal["silent", "validate", "strict"] = field(
143
+ default="validate",
144
+ metadata={
145
+ "title": "Optional Style",
146
+ "description": "The style for reporting issues in optional sections.",
147
+ },
148
+ )
119
149
 
120
150
 
121
151
  ## --------------------------------------------------------------------------- #
@@ -130,13 +160,53 @@ class SectionConfig:
130
160
  Configuration for a docstring section.
131
161
  """
132
162
 
133
- name: str
134
- type: Literal["free_text", "list_name", "list_type", "list_name_and_type"]
135
- order: Optional[int] = None
136
- admonition: Union[bool, str] = False
137
- prefix: str = "" # Support any prefix string
138
- required: bool = False
139
- message: str = "" # Optional message for validation errors
163
+ name: str = field(
164
+ metadata={
165
+ "title": "Name",
166
+ "description": "Name of the docstring section.",
167
+ },
168
+ )
169
+ type: Literal["free_text", "list_name", "list_type", "list_name_and_type"] = field(
170
+ metadata={
171
+ "title": "Type",
172
+ "description": "Type of the section content.",
173
+ },
174
+ )
175
+ order: Optional[int] = field(
176
+ default=None,
177
+ metadata={
178
+ "title": "Order",
179
+ "description": "Order of the section in the docstring.",
180
+ },
181
+ )
182
+ admonition: Union[bool, str] = field(
183
+ default=False,
184
+ metadata={
185
+ "title": "Admonition",
186
+ "description": "Admonition style for the section. Can be False (no admonition) or a string specifying the admonition type.",
187
+ },
188
+ )
189
+ prefix: str = field(
190
+ default="",
191
+ metadata={
192
+ "title": "Prefix",
193
+ "description": "Prefix string for the admonition values.",
194
+ },
195
+ )
196
+ required: bool = field(
197
+ default=False,
198
+ metadata={
199
+ "title": "Required",
200
+ "description": "Whether this section is required in the docstring.",
201
+ },
202
+ )
203
+ message: str = field(
204
+ default="",
205
+ metadata={
206
+ "title": "Message",
207
+ "description": "Optional message for validation errors.",
208
+ },
209
+ )
140
210
 
141
211
  def __post_init__(self) -> None:
142
212
  """