Skip to content

Commit

Permalink
stubber: Docstubs - Fix/undo removal of positional only /) from par…
Browse files Browse the repository at this point in the history
…ameters

Signed-off-by: Jos Verlinde <Jos.Verlinde@microsoft.com>
  • Loading branch information
Josverl committed Aug 25, 2024
1 parent 4a5a79a commit 6833bf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/stubber/rst/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class Fix:
Fix(r"\**", "*"), # change weirdly written wildcards \* --> *
Fix(r"/*", "*"), # change weirdly written wildcards /* --> *
Fix(r"**", "*"), # change weirdly written wildcards ** --> *
Fix(r"/)", ")"), # strange terminator in machine.USBDevice `USBDevice.active(self, [value] /)`
# Fix(r"/)", ")"), # do not fix , this is a positional only notation
Fix("'param'", "param"), # loose notation in documentation
# illegal keywords
Fix(
Expand Down
4 changes: 2 additions & 2 deletions tests/rst/test_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ def test_rst_parse_class_10(line: str):
# ESPNow extra notation
("ESPNow.config('param') (ESP32 only)", "ESPNow.config(param)"),
# machine.USBDevice
# Extranous / `USBDevice.active(self, [value] /)`
("USBDevice.active(self, [value]/)", "USBDevice.active(self, value: Optional[Any]=None)"),
# Positional Only indicator should not be removed / `USBDevice.active(self, [value] /)`
("USBDevice.active(self, [value]/)", "USBDevice.active(self, value: Optional[Any]=None/)"),
],
)
def test_fix_param(param_in, expected):
Expand Down

0 comments on commit 6833bf3

Please sign in to comment.