Repository: karlch/vimiv-qt (language: python)

Issue:
CI: consider using black-only for format checking
After merging #660, I noticed that black (in my pre-commit) still produced a diff, although pylint did not complain.

For consistency, it would be better to only use black for formatting, and disable all related pylint checks and possibly even remove pycodestyle.

Useful command:
```
black --check --diff
```

Sample output:
```
@@ -323,11 +323,11 @@

     ORDER_TYPES: Dict[str, Callable[..., Any]] = {
         "alphabetical": str,
         "natural": natural_sort,
         "recently-modified": os.path.getmtime,
-        "none": lambda x: 0
+        "none": lambda x: 0,
     }

     STR_ORDER_TYPES = "alphabetical", "natural"

     def __init__(
@@ -471,11 +471,11 @@

     size = ThumbnailSizeSetting("thumbnail.size", 128, desc="Size of thumbnails")
     save = BoolSetting(
         "thumbnail.save",
         True,
-        desc="Save new thumbnails to the disk in the shared icon cache for later use"
+        desc="Save new thumbnails to the disk in the shared icon cache for later use",
     )


 class slideshow:  # pylint: disable=invalid-name
     """Namespace for slideshow related settings."""
would reformat ~/Coding/VimivQt/vimiv/api/settings.py

Oh no! 💥 💔 💥
1 file would be reformatted, 92 files would be left unchanged.
```


Discussion / hints:

Fix patch:
diff --git a/misc/requirements/requirements_lint.txt b/misc/requirements/requirements_lint.txt
index 8814e0bb2..b00838dbf 100644
--- a/misc/requirements/requirements_lint.txt
+++ b/misc/requirements/requirements_lint.txt
@@ -1,3 +1,3 @@
 pylint==2.17.4
-pycodestyle==2.10.0
+black==23.7.0
 pydocstyle==6.3.0
diff --git a/tox.ini b/tox.ini
index f32197fc8..21cfce71f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -32,7 +32,7 @@ deps =
 commands =
     pylint vimiv scripts/pylint_checkers
     {toxinidir}/scripts/lint_tests.py tests
-    pycodestyle vimiv tests scripts/pylint_checkers
+    black --check --diff --exclude ".*syntax_error.*" vimiv tests scripts/pylint_checkers
     pydocstyle vimiv scripts/pylint_checkers
 allowlist_externals =
     {toxinidir}/scripts/lint_tests.py
@@ -81,14 +81,6 @@ commands =
     {toxinidir}/scripts/src2rst.py
     sphinx-build -b man docs misc
 
-# Settings for pycodestyle
-[pycodestyle]
-max-line-length = 88
-# E203: whitespace before ':' wrongly raised for slicing
-# E501: line too long checked by pylint
-# W503: line break before binary operator does not conform to pep8
-ignore = E203,E501,W503
-
 # Settings for check-manifest
 [check-manifest]
 ignore =


Test patch:
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index 021eeaf62..3a4e9f23c 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -23,7 +23,6 @@ def cached_method_cls(mocker):
     """Fixture to retrieve a class with mock utilities and a cached method."""
 
     class CachedMethodCls:
-
         RESULT = 42
 
         def __init__(self):
@@ -143,7 +142,6 @@ def test_parameter_names(function):
 @pytest.mark.parametrize("type_hint", ("int", int))
 def test_slot(type_hint):
     class Dummy(QObject):
-
         signal = pyqtSignal(int)
 
         def __init__(self):