pylint: Enable docparams checker

This commit is contained in:
Florian Bruhin 2021-12-03 13:36:20 +01:00
parent 4435ef9287
commit 26d308d95d
20 changed files with 23 additions and 44 deletions

View File

@ -14,6 +14,7 @@ load-plugins=qute_pylint.config,
pylint.extensions.docstyle,
pylint.extensions.check_elif,
pylint.extensions.typing,
pylint.extensions.docparams,
persistent=n
py-version=3.6
@ -55,6 +56,10 @@ disable=locally-disabled,
raise-missing-from,
consider-using-tuple,
consider-using-namedtuple-or-dataclass,
missing-raises-doc,
missing-type-doc,
missing-param-doc,
useless-param-doc,
[BASIC]
function-rgx=[a-z_][a-z0-9_]{2,50}$

View File

@ -299,7 +299,7 @@ class HintActions:
Args:
elem: The QWebElement to download.
_context: The HintContext to use.
context: The HintContext to use.
"""
url = elem.resolve_url(context.baseurl)
if url is None:
@ -1154,7 +1154,6 @@ class WordHinter:
from the words arg as fallback.
Args:
words: Words to use as fallback when no link text can be used.
elems: The elements to get hint strings for.
Return:

View File

@ -92,9 +92,6 @@ def incdec(url, count, inc_or_dec):
url: The current url.
count: How much to increment or decrement by.
inc_or_dec: Either 'increment' or 'decrement'.
tab: Whether to open the link in a new tab.
background: Open the link in a new background tab.
window: Open the link in a new window.
"""
urlutils.ensure_valid(url)
segments: Optional[Set[str]] = (

View File

@ -160,9 +160,6 @@ class AbstractWebElement(collections.abc.MutableMapping): # type: ignore[type-a
def is_content_editable(self) -> bool:
"""Check if an element has a contenteditable attribute.
Args:
elem: The QWebElement to check.
Return:
True if the element has a contenteditable attribute,
False otherwise.

View File

@ -152,9 +152,6 @@ class WebView(QWebView):
Args:
e: The QPaintEvent.
Return:
The superclass event return value.
"""
frame = self.page().mainFrame()
new_pos = (frame.scrollBarValue(Qt.Horizontal),
@ -186,9 +183,6 @@ class WebView(QWebView):
Args:
e: The QShowEvent.
Return:
The superclass event return value.
"""
super().showEvent(e)
self.page().setVisibilityState(QWebPage.VisibilityStateVisible)
@ -198,9 +192,6 @@ class WebView(QWebView):
Args:
e: The QHideEvent.
Return:
The superclass event return value.
"""
super().hideEvent(e)
self.page().setVisibilityState(QWebPage.VisibilityStateHidden)

View File

@ -101,7 +101,7 @@ def type_conv(param, typ, value, *, str_choices=None):
Args:
param: The argparse.Parameter we're checking
types: The allowed type
typ: The allowed type
value: The value to convert
str_choices: The allowed choices if the type ends up being a string

View File

@ -78,7 +78,7 @@ def value(optname, *values, info):
Args:
optname: The name of the config option this model shows.
values: The values already provided on the command line.
*values: The values already provided on the command line.
info: A CompletionInfo instance.
"""
model = completionmodel.CompletionModel(column_widths=(30, 70, 0))

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
# To allow count being documented
# pylint: disable=differing-param-doc
"""Various commands."""
import os

View File

@ -204,7 +204,7 @@ class ConfigCommands:
Args:
option: The name of the option.
values: The values to cycle through.
*values: The values to cycle through.
pattern: The link:configuring{outfilesuffix}#patterns[URL pattern] to use.
temp: Set value temporarily until qutebrowser is closed.
print_: Print the value after setting.

View File

@ -486,7 +486,6 @@ class TabBar(QTabBar):
Args:
idx: The tab index to get the title for.
handle_unset: Whether to return an empty string on KeyError.
"""
try:
return self.tab_data(idx, 'page-title')

View File

@ -109,7 +109,7 @@ def init_faulthandler(fileobj=sys.__stderr__):
when sys.stderr got replaced, e.g. by "Python Tools for Visual Studio".
Args:
fobj: An opened file object to write the traceback to.
fileobj: An opened file object to write the traceback to.
"""
try:
faulthandler.enable(fileobj)

View File

@ -213,7 +213,7 @@ class _FoldArrow(QWidget):
"""Paint the arrow.
Args:
_paint: The QPaintEvent (unused).
_event: The QPaintEvent (unused).
"""
opt = QStyleOption()
opt.initFrom(self)

View File

@ -479,9 +479,6 @@ class SqlTable(QObject):
Args:
field: Field to use as the key.
value: Key value to delete.
Return:
The number of rows deleted.
"""
q = self.database.query(f"DELETE FROM {self._name} where {field} = :val")
q.run(val=value)

View File

@ -18,7 +18,8 @@
# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
# Because every method needs to have a log_stack argument
# pylint: disable=unused-argument
# and because we use *args a lot
# pylint: disable=unused-argument,differing-param-doc
"""Message singleton so we don't have to define unneeded signals."""

View File

@ -382,7 +382,7 @@ def get_repr(obj: Any, constructor: bool = False, **attrs: Any) -> str:
obj: The object to get a repr for.
constructor: If True, show the Foo(one=1, two=2) form instead of
<Foo one=1 two=2>.
attrs: The attributes to add.
**attrs: The attributes to add.
"""
cls = qualname(obj.__class__)
parts = []

View File

@ -909,8 +909,8 @@ class QuteProc(testprocess.Process):
"""Get a screenshot of the current page.
Arguments:
probe: If given, only continue if the pixel at the given position isn't
black (or whatever is specified by probe_color).
probe_pos: If given, only continue if the pixel at the given
position isn't black (or whatever is specified by probe_color).
"""
for _ in range(5):
tmp_path = self.request.getfixturevalue('tmp_path')

View File

@ -163,16 +163,7 @@ def test_completion_item_focus_no_model(which, completionview, model, qtbot):
@pytest.mark.skip("Seems to disagree with reality, see #5897")
def test_completion_item_focus_fetch(completionview, model, qtbot):
"""Test that on_next_prev_item moves the selection properly.
Args:
which: the direction in which to move the selection.
tree: Each list represents a completion category, with each string
being an item under that category.
expected: expected argument from on_selection_changed for each
successive movement. None implies no signal should be
emitted.
"""
"""Test that on_next_prev_item moves the selection properly."""
cat = mock.Mock(spec=[
'layoutChanged', 'layoutAboutToBeChanged', 'canFetchMore',
'fetchMore', 'rowCount', 'index', 'data'])

View File

@ -30,8 +30,8 @@ def expected_text(*args):
"""Helper to format text we expect the KeyHintView to generate.
Args:
args: One tuple for each row in the expected output.
Tuples are of the form: (prefix, color, suffix, command).
*args: One tuple for each row in the expected output.
Tuples are of the form: (prefix, color, suffix, command).
"""
text = '<table>'
for group in args:

View File

@ -334,7 +334,6 @@ def test_get_search_url_open_base_url(config_stub, url, host):
Args:
url: The "URL" to enter.
host: The expected search machine host.
query: The expected search query.
"""
config_stub.val.url.open_base_url = True
url = urlutils._get_search_url(url)

View File

@ -721,7 +721,7 @@ class TestModuleVersions:
Args:
attribute: The name of the version attribute.
expected: The expected return value.
expected_modules: The expected modules with that attribute.
"""
import_fake.version_attribute = attribute