Skip to content

Commit

Permalink
Parse '--check-return-types' in flake8 plugin (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
JenSte authored Jul 21, 2023
1 parent 29c247a commit 2b9caf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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

0 comments on commit 2b9caf0

Please sign in to comment.