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:
Florian Bruhin 2017-05-17 20:20:12 +02:00
parent 12520bf4ba
commit 00a7a0cee6
13 changed files with 25 additions and 32 deletions

View File

@ -30,11 +30,7 @@ disable=no-self-use,
broad-except, broad-except,
bare-except, bare-except,
eval-used, eval-used,
exec-used,
file-ignored,
wrong-import-order,
ungrouped-imports, ungrouped-imports,
redefined-variable-type,
suppressed-message, suppressed-message,
too-many-return-statements, too-many-return-statements,
duplicate-code, duplicate-code,
@ -53,12 +49,9 @@ no-docstring-rgx=(^_|^main$)
[FORMAT] [FORMAT]
max-line-length=79 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 expected-line-ending-format=LF
[SIMILARITIES]
min-similarity-lines=8
[VARIABLES] [VARIABLES]
dummy-variables-rgx=_.* dummy-variables-rgx=_.*
@ -69,12 +62,7 @@ max-args=10
valid-metaclass-classmethod-first-arg=cls valid-metaclass-classmethod-first-arg=cls
[TYPECHECK] [TYPECHECK]
# WORKAROUND for https://github.com/PyCQA/astroid/pull/357 ignored-modules=PyQt5,PyQt5.QtWebKit
ignored-modules=pytest,PyQt5,PyQt5.QtWebKit
# MsgType added as WORKAROUND for [IMPORTS]
# https://bitbucket.org/logilab/pylint/issues/690/ known-standard-library=faulthandler,http
# 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

View File

@ -23,11 +23,12 @@ Contains:
CompletionFilterModel -- A QSortFilterProxyModel subclass for completions. CompletionFilterModel -- A QSortFilterProxyModel subclass for completions.
""" """
import re
from PyQt5.QtCore import QSortFilterProxyModel, QModelIndex, Qt from PyQt5.QtCore import QSortFilterProxyModel, QModelIndex, Qt
from qutebrowser.utils import log, qtutils, debug from qutebrowser.utils import log, qtutils, debug
from qutebrowser.completion.models import base as completion from qutebrowser.completion.models import base as completion
import re
class CompletionFilterModel(QSortFilterProxyModel): class CompletionFilterModel(QSortFilterProxyModel):

View File

@ -35,12 +35,14 @@ import faulthandler
import traceback import traceback
import signal import signal
import importlib import importlib
import pkg_resources
import datetime import datetime
try: try:
import tkinter import tkinter
except ImportError: except ImportError:
tkinter = None tkinter = None
import pkg_resources
# NOTE: No qutebrowser or PyQt import should be done here, as some early # NOTE: No qutebrowser or PyQt import should be done here, as some early
# initialization needs to take place before that! # initialization needs to take place before that!

View File

@ -20,9 +20,9 @@
"""Management of sessions - saved tabs/windows.""" """Management of sessions - saved tabs/windows."""
import os import os
import sip
import os.path import os.path
import sip
from PyQt5.QtCore import pyqtSignal, QUrl, QObject, QPoint, QTimer from PyQt5.QtCore import pyqtSignal, QUrl, QObject, QPoint, QTimer
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
import yaml import yaml

View File

@ -39,7 +39,7 @@ except ImportError:
check_python_version() check_python_version()
from qutebrowser.utils import log from qutebrowser.utils import log
import argparse import argparse # pylint: disable=wrong-import-order
from qutebrowser.misc import earlyinit from qutebrowser.misc import earlyinit

View File

@ -20,10 +20,10 @@
"""Test the built-in directory browser.""" """Test the built-in directory browser."""
import os import os
import bs4
import collections import collections
import pytest import pytest
import bs4
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl
from qutebrowser.utils import urlutils from qutebrowser.utils import urlutils

View File

@ -21,12 +21,12 @@
import os import os
import os.path import os.path
import textwrap
import collections
import yaml import yaml
import pytest import pytest
import bs4 import bs4
import textwrap
import collections
def collect_tests(): def collect_tests():

View File

@ -18,9 +18,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
import pytest
import logging import logging
import pytest
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl
from qutebrowser.utils import usertypes from qutebrowser.utils import usertypes

View File

@ -19,9 +19,10 @@
"""pytest fixtures for tests.keyinput.""" """pytest fixtures for tests.keyinput."""
from unittest import mock
import pytest import pytest
from unittest import mock
from qutebrowser.utils import objreg from qutebrowser.utils import objreg

View File

@ -20,9 +20,10 @@
"""Tests for qutebrowser.misc.lineparser.""" """Tests for qutebrowser.misc.lineparser."""
import os import os
import pytest
from unittest import mock from unittest import mock
import pytest
from qutebrowser.misc import lineparser as lineparsermod from qutebrowser.misc import lineparser as lineparsermod

View File

@ -22,12 +22,12 @@
import contextlib import contextlib
import logging import logging
import os import os
import pytest
import signal import signal
import time import time
from qutebrowser.misc import utilcmds import pytest
from qutebrowser.misc import utilcmds
from qutebrowser.commands import cmdexc from qutebrowser.commands import cmdexc

View File

@ -21,9 +21,9 @@
import os import os
import os.path import os.path
import logging
import pytest import pytest
import logging
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl
from qutebrowser.utils import utils, jinja from qutebrowser.utils import utils, jinja

View File

@ -23,6 +23,8 @@ import io
import os import os
import sys import sys
import os.path import os.path
import unittest
import unittest.mock
try: try:
# pylint: disable=no-name-in-module,useless-suppression # pylint: disable=no-name-in-module,useless-suppression
from test import test_file from test import test_file
@ -31,8 +33,6 @@ except ImportError:
test_file = None test_file = None
import pytest import pytest
import unittest
import unittest.mock
from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice, from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice,
QTimer, QBuffer, QFile, QProcess, QFileDevice) QTimer, QBuffer, QFile, QProcess, QFileDevice)