mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
enable some pylint convention tests in pylib
This commit is contained in:
parent
7e358707e5
commit
f26384a82f
6 changed files with 20 additions and 7 deletions
|
@ -19,7 +19,17 @@ ignored-classes=
|
||||||
output-format=colorized
|
output-format=colorized
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
[MESSAGES CONTROL]
|
||||||
disable=C,R,
|
disable=
|
||||||
|
R,
|
||||||
|
invalid-name,
|
||||||
|
line-too-long,
|
||||||
|
too-many-lines,
|
||||||
|
missing-function-docstring,
|
||||||
|
missing-module-docstring,
|
||||||
|
missing-class-docstring,
|
||||||
|
import-outside-toplevel,
|
||||||
|
wrong-import-position,
|
||||||
|
wrong-import-order,
|
||||||
fixme,
|
fixme,
|
||||||
unused-wildcard-import,
|
unused-wildcard-import,
|
||||||
attribute-defined-outside-init,
|
attribute-defined-outside-init,
|
||||||
|
|
|
@ -452,8 +452,8 @@ insert or ignore into revlog values (?,?,?,?,?,?,?,?,?)""",
|
||||||
self._writeDstMedia(lname, srcData)
|
self._writeDstMedia(lname, srcData)
|
||||||
return match.group(0).replace(fname, lname)
|
return match.group(0).replace(fname, lname)
|
||||||
|
|
||||||
for i in range(len(fields)):
|
for idx, field in enumerate(fields):
|
||||||
fields[i] = self.dst.media.transformNames(fields[i], repl)
|
fields[idx] = self.dst.media.transformNames(field, repl)
|
||||||
return joinFields(fields)
|
return joinFields(fields)
|
||||||
|
|
||||||
# Post-import cleanup
|
# Post-import cleanup
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
# pytype: disable=attribute-error
|
# pytype: disable=attribute-error
|
||||||
# type: ignore
|
# type: ignore
|
||||||
|
# pylint: disable=C
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -683,7 +683,7 @@ did = ? and queue = {QUEUE_TYPE_REV} and due <= ? limit ?""",
|
||||||
f"select 1 from cards where queue = {QUEUE_TYPE_SIBLING_BURIED} and did in %s limit 1"
|
f"select 1 from cards where queue = {QUEUE_TYPE_SIBLING_BURIED} and did in %s limit 1"
|
||||||
% sdids
|
% sdids
|
||||||
)
|
)
|
||||||
return not not cnt
|
return bool(cnt)
|
||||||
|
|
||||||
# Next time reports
|
# Next time reports
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
@ -701,11 +701,11 @@ limit ?"""
|
||||||
now = intTime()
|
now = intTime()
|
||||||
delays = delays[-left:]
|
delays = delays[-left:]
|
||||||
ok = 0
|
ok = 0
|
||||||
for i in range(len(delays)):
|
for idx, delay in enumerate(delays):
|
||||||
now += int(delays[i] * 60)
|
now += int(delay * 60)
|
||||||
if now > self.dayCutoff:
|
if now > self.dayCutoff:
|
||||||
break
|
break
|
||||||
ok = i
|
ok = idx
|
||||||
return ok + 1
|
return ok + 1
|
||||||
|
|
||||||
def _graduatingIvl(
|
def _graduatingIvl(
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# Copyright: Ankitects Pty Ltd and contributors
|
# Copyright: Ankitects Pty Ltd and contributors
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
# pylint: disable=C
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
Loading…
Reference in a new issue