Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Allow skip on module level messages #427

Merged
merged 5 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ New Features
* Extend support for detecting missing argument description in Numpy style
docstrings (#407).
* Added support for Python 3.8 (#423).
* Allow skipping on errors on module level docstring (#427).
Nurdok marked this conversation as resolved.
Show resolved Hide resolved

Bug Fixes

Expand Down
3 changes: 2 additions & 1 deletion src/pydocstyle/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def parse_module(self):
"""Parse a module (and its children) and return a Module object."""
self.log.debug("parsing module.")
start = self.line
skipped_error_codes = self.parse_skip_comment()
docstring = self.parse_docstring()
children = list(self.parse_definitions(Module, dunder_all=True))
assert self.current is None, self.current
Expand All @@ -514,7 +515,7 @@ def parse_module(self):
cls = Package
module = cls(self.filename, self.source, start, end,
[], docstring, children, None, self.dunder_all,
self.dunder_all_error, None, '')
self.dunder_all_error, None, skipped_error_codes)
for child in module.children:
child.parent = module
module.future_imports = self.future_imports
Expand Down
3 changes: 2 additions & 1 deletion src/tests/test_cases/noqa.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test case for "# noqa" comments."""
# noqa: D400,D415
"""Test case for "# noqa" comments"""
from .expected import Expectation


Expand Down