Reorganize pylint config
This removes various stuff we don't need anymoe, and also re-enables and fixes the import order check.
This commit is contained in:
parent
12520bf4ba
commit
00a7a0cee6
22
.pylintrc
22
.pylintrc
@ -30,11 +30,7 @@ disable=no-self-use,
|
||||
broad-except,
|
||||
bare-except,
|
||||
eval-used,
|
||||
exec-used,
|
||||
file-ignored,
|
||||
wrong-import-order,
|
||||
ungrouped-imports,
|
||||
redefined-variable-type,
|
||||
suppressed-message,
|
||||
too-many-return-statements,
|
||||
duplicate-code,
|
||||
@ -53,12 +49,9 @@ no-docstring-rgx=(^_|^main$)
|
||||
|
||||
[FORMAT]
|
||||
max-line-length=79
|
||||
ignore-long-lines=(<?https?://|^# Copyright 201\d|# (pylint|flake8): disable=)
|
||||
ignore-long-lines=(<?https?://|^# Copyright 201\d)
|
||||
expected-line-ending-format=LF
|
||||
|
||||
[SIMILARITIES]
|
||||
min-similarity-lines=8
|
||||
|
||||
[VARIABLES]
|
||||
dummy-variables-rgx=_.*
|
||||
|
||||
@ -69,12 +62,7 @@ max-args=10
|
||||
valid-metaclass-classmethod-first-arg=cls
|
||||
|
||||
[TYPECHECK]
|
||||
# WORKAROUND for https://github.com/PyCQA/astroid/pull/357
|
||||
ignored-modules=pytest,PyQt5,PyQt5.QtWebKit
|
||||
# MsgType added as WORKAROUND for
|
||||
# https://bitbucket.org/logilab/pylint/issues/690/
|
||||
# UnsetObject because pylint infers any objreg.get(...) as UnsetObject.
|
||||
ignored-classes=qutebrowser.utils.objreg.UnsetObject,
|
||||
qutebrowser.browser.webkit.webelem.WebElementWrapper,
|
||||
scripts.dev.check_coverage.MsgType,
|
||||
qutebrowser.browser.downloads.UnsupportedAttribute
|
||||
ignored-modules=PyQt5,PyQt5.QtWebKit
|
||||
|
||||
[IMPORTS]
|
||||
known-standard-library=faulthandler,http
|
||||
|
@ -23,11 +23,12 @@ Contains:
|
||||
CompletionFilterModel -- A QSortFilterProxyModel subclass for completions.
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
from PyQt5.QtCore import QSortFilterProxyModel, QModelIndex, Qt
|
||||
|
||||
from qutebrowser.utils import log, qtutils, debug
|
||||
from qutebrowser.completion.models import base as completion
|
||||
import re
|
||||
|
||||
|
||||
class CompletionFilterModel(QSortFilterProxyModel):
|
||||
|
@ -35,12 +35,14 @@ import faulthandler
|
||||
import traceback
|
||||
import signal
|
||||
import importlib
|
||||
import pkg_resources
|
||||
import datetime
|
||||
try:
|
||||
import tkinter
|
||||
except ImportError:
|
||||
tkinter = None
|
||||
|
||||
import pkg_resources
|
||||
|
||||
# NOTE: No qutebrowser or PyQt import should be done here, as some early
|
||||
# initialization needs to take place before that!
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
"""Management of sessions - saved tabs/windows."""
|
||||
|
||||
import os
|
||||
import sip
|
||||
import os.path
|
||||
|
||||
import sip
|
||||
from PyQt5.QtCore import pyqtSignal, QUrl, QObject, QPoint, QTimer
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
import yaml
|
||||
|
@ -39,7 +39,7 @@ except ImportError:
|
||||
check_python_version()
|
||||
from qutebrowser.utils import log
|
||||
|
||||
import argparse
|
||||
import argparse # pylint: disable=wrong-import-order
|
||||
from qutebrowser.misc import earlyinit
|
||||
|
||||
|
||||
|
@ -20,10 +20,10 @@
|
||||
"""Test the built-in directory browser."""
|
||||
|
||||
import os
|
||||
import bs4
|
||||
import collections
|
||||
|
||||
import pytest
|
||||
import bs4
|
||||
|
||||
from PyQt5.QtCore import QUrl
|
||||
from qutebrowser.utils import urlutils
|
||||
|
@ -21,12 +21,12 @@
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import textwrap
|
||||
import collections
|
||||
|
||||
import yaml
|
||||
import pytest
|
||||
import bs4
|
||||
import textwrap
|
||||
import collections
|
||||
|
||||
|
||||
def collect_tests():
|
||||
|
@ -18,9 +18,9 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import pytest
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
from PyQt5.QtCore import QUrl
|
||||
|
||||
from qutebrowser.utils import usertypes
|
||||
|
@ -19,9 +19,10 @@
|
||||
|
||||
"""pytest fixtures for tests.keyinput."""
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from unittest import mock
|
||||
from qutebrowser.utils import objreg
|
||||
|
||||
|
||||
|
@ -20,9 +20,10 @@
|
||||
"""Tests for qutebrowser.misc.lineparser."""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from qutebrowser.misc import lineparser as lineparsermod
|
||||
|
||||
|
||||
|
@ -22,12 +22,12 @@
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import pytest
|
||||
import signal
|
||||
import time
|
||||
|
||||
from qutebrowser.misc import utilcmds
|
||||
import pytest
|
||||
|
||||
from qutebrowser.misc import utilcmds
|
||||
from qutebrowser.commands import cmdexc
|
||||
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
import logging
|
||||
from PyQt5.QtCore import QUrl
|
||||
|
||||
from qutebrowser.utils import utils, jinja
|
||||
|
@ -23,6 +23,8 @@ import io
|
||||
import os
|
||||
import sys
|
||||
import os.path
|
||||
import unittest
|
||||
import unittest.mock
|
||||
try:
|
||||
# pylint: disable=no-name-in-module,useless-suppression
|
||||
from test import test_file
|
||||
@ -31,8 +33,6 @@ except ImportError:
|
||||
test_file = None
|
||||
|
||||
import pytest
|
||||
import unittest
|
||||
import unittest.mock
|
||||
from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice,
|
||||
QTimer, QBuffer, QFile, QProcess, QFileDevice)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user