Skip to content

Commit

Permalink
Functional tests for docparams extension docstring-min-length fix
Browse files Browse the repository at this point in the history
  • Loading branch information
berker.sal committed Dec 6, 2024
1 parent c750d7b commit 1f425b3
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Tests for missing-raises-doc for non-specified style docstrings
with accept-no-raise-doc = no and docstring-min-length = 3
"""
# pylint: disable=invalid-name

# Example of a function that is less than 'docstring-min-length' config option
# No error message is emitted.
def test_skip_docstring_min_length():
"""function is too short and is missing raise documentation"""
raise Exception
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[MAIN]
load-plugins = pylint.extensions.docparams

[BASIC]
accept-no-raise-doc=no
docstring-min-length=3
no-docstring-rgx=^$
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Tests for missing-return-doc for non-specified style docstrings
with accept-no-return-doc = no and docstring-min-length = 3
"""
# pylint: disable=invalid-name

# Example of a function that is less than 'docstring-min-length' config option
# No error message is emitted.
def test_skip_docstring_min_length() -> None:
"""function is too short and is missing return documentation"""
return None
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[MAIN]
load-plugins = pylint.extensions.docparams

[BASIC]
accept-no-return-doc=no
docstring-min-length=3
no-docstring-rgx=^$
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Tests for missing-yield-doc for non-specified style docstrings
with accept-no-yields-doc = no and docstring-min-length = 3
"""
# pylint: disable=invalid-name

# Example of a function that is less than 'docstring-min-length' config option
# No error message is emitted.
def test_skip_docstring_min_length():
"""function is too short and is missing yield documentation"""
yield None
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[MAIN]
load-plugins = pylint.extensions.docparams

[BASIC]
accept-no-yields-doc=no
docstring-min-length=3
no-docstring-rgx=^$

0 comments on commit 1f425b3

Please sign in to comment.