Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## [0.6.6] - 2025-04-16

- Fixed
- A bug where double quotes in function signature type hints are not treated
as interchangeable as double quotes in the docstring
- Changed
- Changed the default of option `--quiet` from False to True
- Full diff
- https://github.com/jsh9/pydoclint/compare/0.6.5...0.6.6

## [0.6.5] - 2025-04-03

- Fixed
Expand Down
2 changes: 1 addition & 1 deletion pydoclint/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def validateStyleValue(
'-q',
'--quiet',
is_flag=True,
default=False,
default=True,
help='If True, do not print the file names being checked to the terminal.',
)
@click.option(
Expand Down
4 changes: 2 additions & 2 deletions pydoclint/utils/arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from docstring_parser.common import DocstringAttr, DocstringParam

from pydoclint.utils.edge_case_error import EdgeCaseError
from pydoclint.utils.generic import stripQuotes
from pydoclint.utils.generic import specialEqual, stripQuotes
from pydoclint.utils.unparser_custom import unparseName


Expand Down Expand Up @@ -129,7 +129,7 @@ def _typeHintsEq(cls, hint1: str, hint2: str) -> bool:
except SyntaxError:
hint2_ = hint2

return hint1_ == hint2_
return specialEqual(hint1_, hint2_)

@classmethod
def _removeEscapeChar(cls, string: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pydoclint
version = 0.6.5
version = 0.6.6
description = A Python docstring linter that checks arguments, returns, yields, and raises sections
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# fmt: off

# This edge case comes from https://github.com/jsh9/pydoclint/issues/105
# The edge cases comes from:
# https://github.com/jsh9/pydoclint/issues/105
# https://github.com/jsh9/pydoclint/issues/231

from __future__ import annotations

Expand Down Expand Up @@ -44,3 +46,18 @@ def func_3(arg1: Literal['foo']) -> tuple[Literal['foo'], Literal["bar"]]:
tuple[Literal['foo'], Literal["bar"]]: The literal strings 'foo' & "bar"
"""
return 'foo', "bar"


async def upload_tickets(
file: Annotated[UploadFile, File(description="Excel file with tickets")],
) -> dict:
"""
Upload and process tickets from an Excel file.

Args:
file (Annotated[UploadFile, File(description="Excel file with tickets")]): The file

Returns:
dict: Processed ticket data.
"""
pass
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# fmt: off

# This edge case comes from https://github.com/jsh9/pydoclint/issues/105
# The edge cases comes from:
# https://github.com/jsh9/pydoclint/issues/105
# https://github.com/jsh9/pydoclint/issues/231


from __future__ import annotations

Expand Down Expand Up @@ -55,3 +58,22 @@ def func_3() -> tuple[Literal['foo'], Literal["bar"]]:
the function signature.
"""
return "foo", 'bar'


async def upload_tickets(
file: Annotated[UploadFile, File(description="Excel file with tickets")],
) -> dict:
"""
Upload and process tickets from an Excel file.

Parameters
----------
file : Annotated[UploadFile, File(description="Excel file with tickets")]
The uploaded Excel file containing ticket data.

Returns
-------
dict
Processed ticket data.
"""
pass
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,8 +1461,8 @@ def testNonAscii() -> None:
],
),
('08_return_section_parsing/google.py', {'style': 'google'}, []),
('09_double_quotes_in_Literal/google.py', {'style': 'google'}, []),
('09_double_quotes_in_Literal/numpy.py', {'style': 'numpy'}, []),
('09_double_quotes/google.py', {'style': 'google'}, []),
('09_double_quotes/numpy.py', {'style': 'numpy'}, []),
(
'10_absent_return_anno/numpy.py',
{'style': 'numpy'},
Expand Down