flake8-docstrings

This commit is contained in:
Andrey Rakhmatullin 2024-06-19 23:57:40 +05:00
parent 1c70d3e605
commit 1ef9c337ca
4 changed files with 36 additions and 2 deletions

33
.flake8
View File

@ -2,11 +2,44 @@
max-line-length = 119
ignore =
# black disagrees with flake8 about these
E203, E501, E701, E704, W503
# docstring does contain unindexed parameters
P102
# other string does contain unindexed parameters
P103
# Missing docstring in public module
D100
# Missing docstring in public class
D101
# Missing docstring in public method
D102
# Missing docstring in public function
D103
# Missing docstring in public package
D104
# Missing docstring in magic method
D105
# Missing docstring in public nested class
D106
# Missing docstring in __init__
D107
# One-line docstring should fit on one line with quotes
D200
# No blank lines allowed after function docstring
D202
# 1 blank line required between summary line and description
D205
# Multi-line docstring closing quotes should be on a separate line
D209
# First line should end with a period
D400
# First line should be in imperative mood; try rephrasing
D401
# First line should not be the function's "signature"
D402
# First word of the first line should be properly capitalized
D403
exclude =
docs/conf.py

View File

@ -11,6 +11,7 @@ repos:
additional_dependencies:
- flake8-comprehensions
- flake8-debugger
- flake8-docstrings
- flake8-string-format
- repo: https://github.com/psf/black.git
rev: 24.2.0

View File

@ -146,7 +146,7 @@ class RFPDupeFilterTest(unittest.TestCase):
case_insensitive_dupefilter.close("finished")
def test_seenreq_newlines(self):
"""Checks against adding duplicate \r to
r"""Checks against adding duplicate \r to
line endings on Windows platforms."""
r1 = Request("http://scrapytest.org/1")

View File

@ -186,7 +186,7 @@ class Base:
)
def test_nofollow(self):
'''Test the extractor's behaviour for links with rel="nofollow"'''
"""Test the extractor's behaviour for links with rel='nofollow'"""
html = b"""<html><head><title>Page title<title>
<body>