docsig 0.85.0__tar.gz → 0.85.1__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: docsig
3
- Version: 0.85.0
3
+ Version: 0.85.1
4
4
  Summary: Check signature params for proper documentation
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -195,7 +195,7 @@ ensure your installation has registered `docsig`
195
195
  .. code-block:: console
196
196
 
197
197
  $ flake8 --version
198
- 7.3.0 (docsig: 0.85.0, mccabe: 0.7.0, pycodestyle: 2.14.0, pyflakes: 3.4.0) CPython 3.10.19 on Darwin
198
+ 7.3.0 (docsig: 0.85.1, mccabe: 0.7.0, pycodestyle: 2.14.0, pyflakes: 3.4.0) CPython 3.10.19 on Darwin
199
199
 
200
200
  And now use `flake8` to lint your files
201
201
 
@@ -281,7 +281,7 @@ Standalone
281
281
 
282
282
  repos:
283
283
  - repo: https://github.com/jshwi/docsig
284
- rev: v0.85.0
284
+ rev: v0.85.1
285
285
  hooks:
286
286
  - id: docsig
287
287
  args:
@@ -300,7 +300,7 @@ or integrated with ``flake8``
300
300
  hooks:
301
301
  - id: flake8
302
302
  additional_dependencies:
303
- - docsig==0.85.0
303
+ - docsig==0.85.1
304
304
  args:
305
305
  - "--sig-check-class"
306
306
  - "--sig-check-dunders"
@@ -166,7 +166,7 @@ ensure your installation has registered `docsig`
166
166
  .. code-block:: console
167
167
 
168
168
  $ flake8 --version
169
- 7.3.0 (docsig: 0.85.0, mccabe: 0.7.0, pycodestyle: 2.14.0, pyflakes: 3.4.0) CPython 3.10.19 on Darwin
169
+ 7.3.0 (docsig: 0.85.1, mccabe: 0.7.0, pycodestyle: 2.14.0, pyflakes: 3.4.0) CPython 3.10.19 on Darwin
170
170
 
171
171
  And now use `flake8` to lint your files
172
172
 
@@ -252,7 +252,7 @@ Standalone
252
252
 
253
253
  repos:
254
254
  - repo: https://github.com/jshwi/docsig
255
- rev: v0.85.0
255
+ rev: v0.85.1
256
256
  hooks:
257
257
  - id: docsig
258
258
  args:
@@ -271,7 +271,7 @@ or integrated with ``flake8``
271
271
  hooks:
272
272
  - id: flake8
273
273
  additional_dependencies:
274
- - docsig==0.85.0
274
+ - docsig==0.85.1
275
275
  args:
276
276
  - "--sig-check-class"
277
277
  - "--sig-check-dunders"
@@ -104,7 +104,11 @@ class Directives(dict[int, tuple[Comments, _Messages]]):
104
104
  """
105
105
 
106
106
  @classmethod
107
- def from_text(cls, text: str, messages: _Messages) -> Directives:
107
+ def from_text( # pylint: disable=too-many-locals
108
+ cls,
109
+ text: str,
110
+ messages: _Messages,
111
+ ) -> Directives:
108
112
  """Build a directives map from docsig directives in the code.
109
113
 
110
114
  :param text: Python source code to scan for directives.
@@ -117,6 +121,8 @@ class Directives(dict[int, tuple[Comments, _Messages]]):
117
121
  enable_next = False
118
122
  next_comments = Comments(comments)
119
123
  next_messages = _Messages(messages)
124
+ pending_inline: tuple[Comments, _Messages] | None = None
125
+ pending_inline_lineno: int | None = None
120
126
  for line in _tokenize.generate_tokens(fin.readline):
121
127
  # do nothing for these line types
122
128
  if line.type in (_tokenize.NAME, _tokenize.OP, _tokenize.DEDENT):
@@ -154,6 +160,14 @@ class Directives(dict[int, tuple[Comments, _Messages]]):
154
160
  if comment.ismodule:
155
161
  comments = scoped_comments
156
162
  messages = scoped_messages
163
+ else:
164
+ # defer scoped state for the next line without
165
+ # changing module-level messages
166
+ pending_inline = (
167
+ Comments(scoped_comments),
168
+ _Messages(scoped_messages),
169
+ )
170
+ pending_inline_lineno = lineno
157
171
 
158
172
  # if in a 'next' module level scope and the line type is a
159
173
  # newline (not a comment to allow 'next' directives to be
@@ -164,6 +178,17 @@ class Directives(dict[int, tuple[Comments, _Messages]]):
164
178
  comments = next_comments
165
179
  messages = next_messages
166
180
 
181
+ # inherit deferred inline scope on the first line after
182
+ # the comment (e.g. an indented def on the following line)
183
+ if (
184
+ pending_inline is not None
185
+ and pending_inline_lineno is not None
186
+ and lineno > pending_inline_lineno
187
+ ):
188
+ scoped_comments, scoped_messages = pending_inline
189
+ pending_inline = None
190
+ pending_inline_lineno = None
191
+
167
192
  # check that a scoped message has not updated this first, as
168
193
  # they take precedence over global messages
169
194
  if lineno not in directives:
@@ -8,4 +8,4 @@ Allows for access to the version internally without cyclic imports
8
8
  caused by accessing it through __init__.
9
9
  """
10
10
 
11
- __version__ = "0.85.0"
11
+ __version__ = "0.85.1"
@@ -11,7 +11,7 @@ line-length = 79
11
11
  allow_dirty = true
12
12
  commit = true
13
13
  commit_args = "-sS"
14
- current_version = "0.85.0"
14
+ current_version = "0.85.1"
15
15
  message = "bump: version {current_version} → {new_version}"
16
16
  sign_tags = true
17
17
  tag = true
@@ -122,7 +122,7 @@ maintainers = [
122
122
  name = "docsig"
123
123
  readme = "README.rst"
124
124
  repository = "https://github.com/jshwi/docsig"
125
- version = "0.85.0"
125
+ version = "0.85.1"
126
126
 
127
127
  [tool.poetry.dependencies]
128
128
  Sphinx = ">=7,<9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes