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

Parse '--check-return-types' in flake8 plugin #52

Merged
merged 2 commits into from
Jul 21, 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.3] - 2023-07-21

- Fixed
- Pass `--check-return-types` option to flake8 plugin
- Full diff
- https://github.com/jsh9/pydoclint/compare/0.1.2...0.1.3

## [0.1.2] - 2023-07-20

- Fixed
Expand Down
6 changes: 6 additions & 0 deletions pydoclint/flake8_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def parse_options(cls, options): # noqa: D102
cls.require_return_section_when_returning_none = (
options.require_return_section_when_returning_none
)
cls.check_return_types = options.check_return_types
cls.style = options.style

def run(self) -> Generator[Tuple[int, int, str, Any], None, None]:
Expand Down Expand Up @@ -170,6 +171,10 @@ def run(self) -> Generator[Tuple[int, int, str, Any], None, None]:
'--require-return-section-when-returning-none',
self.require_return_section_when_returning_none,
)
checkReturnTypes = self._bool(
'--check-return-types',
self.check_return_types,
)

if self.style not in {'numpy', 'google', 'sphinx'}:
raise ValueError(
Expand All @@ -184,6 +189,7 @@ def run(self) -> Generator[Tuple[int, int, str, Any], None, None]:
skipCheckingRaises=skipCheckingRaises,
allowInitDocstring=allowInitDocstring,
requireReturnSectionWhenReturningNone=requireReturnSectionWhenReturningNone,
checkReturnTypes=checkReturnTypes,
style=self.style,
)
v.visit(self._tree)
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.2
version = 0.1.3
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