From a765ab95ec128cb8e46579509f73350c513e3232 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Mon, 25 Oct 2021 11:10:56 +0200 Subject: [PATCH] Enable invalid-name globally in pylib (#1454) --- pylib/.pylintrc | 1 - pylib/anki/__init__.py | 2 -- pylib/anki/_backend/__init__.py | 2 -- pylib/anki/_backend/genbackend.py | 2 -- pylib/anki/_backend/genfluent.py | 2 -- pylib/anki/_legacy.py | 2 -- pylib/anki/browser.py | 2 -- pylib/anki/buildinfo.py | 2 -- pylib/anki/cards.py | 2 -- pylib/anki/collection.py | 2 -- pylib/anki/config.py | 2 -- pylib/anki/consts.py | 2 -- pylib/anki/db.py | 2 -- pylib/anki/dbproxy.py | 2 -- pylib/anki/decks.py | 2 -- pylib/anki/errors.py | 2 -- pylib/anki/find.py | 2 ++ pylib/anki/hooks.py | 2 ++ pylib/anki/httpclient.py | 2 -- pylib/anki/importing/base.py | 2 ++ pylib/anki/importing/csvfile.py | 2 ++ pylib/anki/importing/pauker.py | 2 ++ pylib/anki/lang.py | 2 -- pylib/anki/latex.py | 2 -- pylib/anki/media.py | 2 -- pylib/anki/models.py | 2 -- pylib/anki/notes.py | 2 -- pylib/anki/scheduler/__init__.py | 2 -- pylib/anki/scheduler/base.py | 2 -- pylib/anki/scheduler/v3.py | 2 ++ pylib/anki/sound.py | 2 -- pylib/anki/statsbg.py | 2 ++ pylib/anki/stdmodels.py | 2 -- pylib/anki/storage.py | 2 -- pylib/anki/sync.py | 2 -- pylib/anki/syncserver/__init__.py | 2 -- pylib/anki/syncserver/__main__.py | 2 -- pylib/anki/tags.py | 2 -- pylib/anki/template.py | 2 -- pylib/anki/types.py | 2 -- pylib/anki/utils.py | 2 -- 41 files changed, 14 insertions(+), 67 deletions(-) diff --git a/pylib/.pylintrc b/pylib/.pylintrc index 06663f865..00f2ef605 100644 --- a/pylib/.pylintrc +++ b/pylib/.pylintrc @@ -26,7 +26,6 @@ output-format=colorized [MESSAGES CONTROL] disable= R, - invalid-name, line-too-long, too-many-lines, missing-function-docstring, diff --git a/pylib/anki/__init__.py b/pylib/anki/__init__.py index 20376cab9..e3d8b5638 100644 --- a/pylib/anki/__init__.py +++ b/pylib/anki/__init__.py @@ -1,4 +1,2 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - -# pylint: enable=invalid-name diff --git a/pylib/anki/_backend/__init__.py b/pylib/anki/_backend/__init__.py index 2f29831bb..d486d9ab3 100644 --- a/pylib/anki/_backend/__init__.py +++ b/pylib/anki/_backend/__init__.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import sys diff --git a/pylib/anki/_backend/genbackend.py b/pylib/anki/_backend/genbackend.py index 2a546ef57..e4ce2f801 100755 --- a/pylib/anki/_backend/genbackend.py +++ b/pylib/anki/_backend/genbackend.py @@ -2,8 +2,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - import os import re import sys diff --git a/pylib/anki/_backend/genfluent.py b/pylib/anki/_backend/genfluent.py index ae145eb14..fae0c37cd 100644 --- a/pylib/anki/_backend/genfluent.py +++ b/pylib/anki/_backend/genfluent.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - import json import sys from typing import List, Literal, TypedDict diff --git a/pylib/anki/_legacy.py b/pylib/anki/_legacy.py index 80d481875..e4209aebb 100644 --- a/pylib/anki/_legacy.py +++ b/pylib/anki/_legacy.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import functools diff --git a/pylib/anki/browser.py b/pylib/anki/browser.py index e28990c7b..8563ed229 100644 --- a/pylib/anki/browser.py +++ b/pylib/anki/browser.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - class BrowserConfig: ACTIVE_CARD_COLUMNS_KEY = "activeCols" diff --git a/pylib/anki/buildinfo.py b/pylib/anki/buildinfo.py index d63103004..89230adcc 100644 --- a/pylib/anki/buildinfo.py +++ b/pylib/anki/buildinfo.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from importlib.resources import open_text diff --git a/pylib/anki/cards.py b/pylib/anki/cards.py index 0d7785ec2..f79f94d76 100644 --- a/pylib/anki/cards.py +++ b/pylib/anki/cards.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import pprint diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index 4df8328bf..9a88d5dba 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations from typing import Any, Generator, Literal, Sequence, Union, cast diff --git a/pylib/anki/config.py b/pylib/anki/config.py index 6e7b9c817..61d3e9357 100644 --- a/pylib/anki/config.py +++ b/pylib/anki/config.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - """ Config handling diff --git a/pylib/anki/consts.py b/pylib/anki/consts.py index 7ffe98bf2..dd0199f6b 100644 --- a/pylib/anki/consts.py +++ b/pylib/anki/consts.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import sys diff --git a/pylib/anki/db.py b/pylib/anki/db.py index 2ed821768..f05becb08 100644 --- a/pylib/anki/db.py +++ b/pylib/anki/db.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - """ A convenience wrapper over pysqlite. diff --git a/pylib/anki/dbproxy.py b/pylib/anki/dbproxy.py index c5aa908ce..06f01739a 100644 --- a/pylib/anki/dbproxy.py +++ b/pylib/anki/dbproxy.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import re diff --git a/pylib/anki/decks.py b/pylib/anki/decks.py index 3217f1f39..5f2d563ab 100644 --- a/pylib/anki/decks.py +++ b/pylib/anki/decks.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import copy diff --git a/pylib/anki/errors.py b/pylib/anki/errors.py index 725dceb0c..1514916d4 100644 --- a/pylib/anki/errors.py +++ b/pylib/anki/errors.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations from enum import Enum diff --git a/pylib/anki/find.py b/pylib/anki/find.py index 3724b64d4..fbd6d908a 100644 --- a/pylib/anki/find.py +++ b/pylib/anki/find.py @@ -1,6 +1,8 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +# pylint: disable=invalid-name + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/pylib/anki/hooks.py b/pylib/anki/hooks.py index 8efb78bcf..9e360ebfa 100644 --- a/pylib/anki/hooks.py +++ b/pylib/anki/hooks.py @@ -1,6 +1,8 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +# pylint: disable=invalid-name + """ Tools for extending Anki. diff --git a/pylib/anki/httpclient.py b/pylib/anki/httpclient.py index ebcc5b97c..b16e43eb5 100644 --- a/pylib/anki/httpclient.py +++ b/pylib/anki/httpclient.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - """ Wrapper for requests that adds a callback for tracking upload/download progress. """ diff --git a/pylib/anki/importing/base.py b/pylib/anki/importing/base.py index 6d53d0d24..0e7901b11 100644 --- a/pylib/anki/importing/base.py +++ b/pylib/anki/importing/base.py @@ -1,6 +1,8 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +# pylint: disable=invalid-name + from typing import Any, Optional from anki.collection import Collection diff --git a/pylib/anki/importing/csvfile.py b/pylib/anki/importing/csvfile.py index 41ed93614..3769cb4c3 100644 --- a/pylib/anki/importing/csvfile.py +++ b/pylib/anki/importing/csvfile.py @@ -1,6 +1,8 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +# pylint: disable=invalid-name + from __future__ import annotations import csv diff --git a/pylib/anki/importing/pauker.py b/pylib/anki/importing/pauker.py index 99a1bfbfb..ea5c45082 100644 --- a/pylib/anki/importing/pauker.py +++ b/pylib/anki/importing/pauker.py @@ -1,6 +1,8 @@ # Copyright: Andreas Klauer # License: BSD-3 +# pylint: disable=invalid-name + import gzip import html import math diff --git a/pylib/anki/lang.py b/pylib/anki/lang.py index 827dc40c4..d1b826a07 100644 --- a/pylib/anki/lang.py +++ b/pylib/anki/lang.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import locale diff --git a/pylib/anki/latex.py b/pylib/anki/latex.py index a73003b6a..fc791d198 100644 --- a/pylib/anki/latex.py +++ b/pylib/anki/latex.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import html diff --git a/pylib/anki/media.py b/pylib/anki/media.py index 15c03c070..25b34ccb9 100644 --- a/pylib/anki/media.py +++ b/pylib/anki/media.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import os diff --git a/pylib/anki/models.py b/pylib/anki/models.py index 7f34872aa..02e39a1b3 100644 --- a/pylib/anki/models.py +++ b/pylib/anki/models.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import copy diff --git a/pylib/anki/notes.py b/pylib/anki/notes.py index 510a7df59..b78106475 100644 --- a/pylib/anki/notes.py +++ b/pylib/anki/notes.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import copy diff --git a/pylib/anki/scheduler/__init__.py b/pylib/anki/scheduler/__init__.py index f80f447eb..46ad82b02 100644 --- a/pylib/anki/scheduler/__init__.py +++ b/pylib/anki/scheduler/__init__.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import sys diff --git a/pylib/anki/scheduler/base.py b/pylib/anki/scheduler/base.py index f9e4b2cb7..b47831272 100644 --- a/pylib/anki/scheduler/base.py +++ b/pylib/anki/scheduler/base.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import anki diff --git a/pylib/anki/scheduler/v3.py b/pylib/anki/scheduler/v3.py index d28d6eb9f..c92398e6c 100644 --- a/pylib/anki/scheduler/v3.py +++ b/pylib/anki/scheduler/v3.py @@ -1,6 +1,8 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +# pylint: disable=invalid-name + """ This file contains experimental scheduler changes: diff --git a/pylib/anki/sound.py b/pylib/anki/sound.py index a21e8207c..3d375f716 100644 --- a/pylib/anki/sound.py +++ b/pylib/anki/sound.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - """ Sound/TTS references extracted from card text. diff --git a/pylib/anki/statsbg.py b/pylib/anki/statsbg.py index 2e099322c..6c67601d5 100644 --- a/pylib/anki/statsbg.py +++ b/pylib/anki/statsbg.py @@ -1,3 +1,5 @@ +# pylint: disable=invalid-name + # from subtlepatterns.com; CC BY-SA 3.0. # by Daniel Beaton # https://www.toptal.com/designers/subtlepatterns/fancy-deboss/ diff --git a/pylib/anki/stdmodels.py b/pylib/anki/stdmodels.py index 83d79ce80..fff7f0702 100644 --- a/pylib/anki/stdmodels.py +++ b/pylib/anki/stdmodels.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations from typing import Any, Callable, no_type_check diff --git a/pylib/anki/storage.py b/pylib/anki/storage.py index ad2a1b156..bf71689cd 100644 --- a/pylib/anki/storage.py +++ b/pylib/anki/storage.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - # Legacy code expects to find Collection in this module. from anki.collection import Collection diff --git a/pylib/anki/sync.py b/pylib/anki/sync.py index 7d9218832..e52611d30 100644 --- a/pylib/anki/sync.py +++ b/pylib/anki/sync.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from anki import sync_pb2 # public exports diff --git a/pylib/anki/syncserver/__init__.py b/pylib/anki/syncserver/__init__.py index 0d21cb87a..cadee9a8c 100644 --- a/pylib/anki/syncserver/__init__.py +++ b/pylib/anki/syncserver/__init__.py @@ -4,8 +4,6 @@ # Please see /docs/syncserver.md # -# pylint: enable=invalid-name - from __future__ import annotations import gzip diff --git a/pylib/anki/syncserver/__main__.py b/pylib/anki/syncserver/__main__.py index 795c8e86d..01e371ae6 100644 --- a/pylib/anki/syncserver/__main__.py +++ b/pylib/anki/syncserver/__main__.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from anki.syncserver import serve serve() diff --git a/pylib/anki/tags.py b/pylib/anki/tags.py index cf3d9569f..390900ae4 100644 --- a/pylib/anki/tags.py +++ b/pylib/anki/tags.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - """ Anki maintains a cache of used tags so it can quickly present a list of tags for autocomplete and in the browser. For efficiency, deletions are not diff --git a/pylib/anki/template.py b/pylib/anki/template.py index d1654485c..dd7673f1a 100644 --- a/pylib/anki/template.py +++ b/pylib/anki/template.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - """ This file contains the Python portion of the template rendering code. diff --git a/pylib/anki/types.py b/pylib/anki/types.py index 6ff8f1bdc..d6f1406a2 100644 --- a/pylib/anki/types.py +++ b/pylib/anki/types.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from typing import NoReturn diff --git a/pylib/anki/utils.py b/pylib/anki/utils.py index dd2e9a383..537b7c3ff 100644 --- a/pylib/anki/utils.py +++ b/pylib/anki/utils.py @@ -1,8 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -# pylint: enable=invalid-name - from __future__ import annotations import json as _json