Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of 'sphinx' as style argument #48

Merged
merged 2 commits into from
Jul 19, 2023
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [0.1.1] - 2023-07-18

- Fixed
- Fixed incorrect blocking of "sphinx" style in CLI arguments
- Full diff
- https://github.com/jsh9/pydoclint/compare/0.1.0...0.1.1

## [0.1.0] - 2023-07-15

- Added
Expand Down
4 changes: 2 additions & 2 deletions pydoclint/flake8_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def run(self) -> Generator[Tuple[int, int, str, Any], None, None]:
self.require_return_section_when_returning_none,
)

if self.style not in {'numpy', 'google'}:
if self.style not in {'numpy', 'google', 'sphinx'}:
raise ValueError(
'Invalid value for "--style": must be "numpy" or "google"'
'Invalid value for "--style": must be "numpy", "google", or "sphinx"'
)

v = Visitor(
Expand Down
2 changes: 1 addition & 1 deletion pydoclint/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def validateStyleValue(
value: Optional[str],
) -> Optional[str]:
"""Validate the value of the 'style' option"""
if value not in {'numpy', 'google'}:
if value not in {'numpy', 'google', 'sphinx'}:
raise click.BadParameter(
'"--style" must be "numpy", "google", or "sphinx"'
)
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.1.0
version = 0.1.1
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