Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
* Allow # type: ignore lines to be long.
* Fix import order and unused import.
* Do not use pylint for member check of PyQt / PySide objects. The error
  is still caught by mypy.
  • Loading branch information
karlch committed Jul 12, 2023
1 parent 06dedc9 commit 3eb336c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ no-docstring-rgx=(^__|^main$|^test_|decorator|inside|^_on)
[FORMAT]
max-line-length=88
max-module-lines=1000
ignore-long-lines=(<?https?://|^# Copyright 201\d|# (pylint|flake8): disable=)
ignore-long-lines=(<?https?://|^# Copyright 201\d|# (pylint|flake8): disable=|# type: ignore)
expected-line-ending-format=LF

[SIMILARITIES]
Expand All @@ -58,3 +58,6 @@ max-args=10

[CLASSES]
valid-metaclass-classmethod-first-arg=cls

[TYPECHECK]
ignored-modules=PyQt5,PyQt6,PySide6
5 changes: 2 additions & 3 deletions tests/end2end/features/edit/test_crop_bdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import re

from vimiv.qt.core import Qt, QPoint
from vimiv.qt.widgets import QApplication

import pytest
import pytest_bdd as bdd

import vimiv.gui.crop_widget
from vimiv.qt.core import Qt, QPoint
from vimiv.qt.widgets import QApplication


bdd.scenarios("crop.feature")
Expand Down
2 changes: 1 addition & 1 deletion vimiv/gui/crop_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""Widget to display a rectangle for cropping and interact with image and transform."""

from vimiv.qt import USE_PYQT5
from vimiv.qt.core import Qt, QPoint, QPointF, QRect, QRectF, QSize
from vimiv.qt.core import Qt, QPoint, QRect, QRectF, QSize
from vimiv.qt.gui import QPainter, QColor, QImage
from vimiv.qt.widgets import QApplication, QStyle, QStyleOption, QWidget

Expand Down
1 change: 1 addition & 0 deletions vimiv/qt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@


class Align:
"""Namespace for easier access to the Qt alignment flags."""

Center = Qt.AlignmentFlag.AlignCenter
Left = Qt.AlignmentFlag.AlignLeft
Expand Down

0 comments on commit 3eb336c

Please sign in to comment.