Skip to content

Commit bf7af69

Browse files
committed
Upgrade flake8 in pre-commit and fix new warnings
Upgrading flake8 from 6.0.0 to 6.1.0 causes its pycodestyle dependency to be upgraded from 2.10.* to 2.11.*, which is desirable because: - Spurious "E231 missing whitespace after ':'" warnings on 3.12 due to the lack of full compatibility with Python 3.12 are gone. - New warnings appear, at least one of which, "E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`", does identify something we can improve. This upgrades flake8 in pre-commit and fixes the new warnings.
1 parent a5a6464 commit bf7af69

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Diff for: .pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/PyCQA/flake8
3-
rev: 6.0.0
3+
rev: 6.1.0
44
hooks:
55
- id: flake8
66
additional_dependencies:

Diff for: git/objects/submodule/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ def iter_items(
14031403
# END handle critical error
14041404

14051405
# Make sure we are looking at a submodule object
1406-
if type(sm) != git.objects.submodule.base.Submodule:
1406+
if type(sm) is not git.objects.submodule.base.Submodule:
14071407
continue
14081408

14091409
# fill in remaining info - saves time as it doesn't have to be parsed again

Diff for: git/refs/log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def entry_at(cls, filepath: PathLike, index: int) -> "RefLogEntry":
244244
for i in range(index + 1):
245245
line = fp.readline()
246246
if not line:
247-
raise IndexError(f"Index file ended at line {i+1}, before given index was reached")
247+
raise IndexError(f"Index file ended at line {i + 1}, before given index was reached")
248248
# END abort on eof
249249
# END handle runup
250250

Diff for: git/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ class IterableClassWatcher(type):
11361136

11371137
def __init__(cls, name: str, bases: Tuple, clsdict: Dict) -> None:
11381138
for base in bases:
1139-
if type(base) == IterableClassWatcher:
1139+
if type(base) is IterableClassWatcher:
11401140
warnings.warn(
11411141
f"GitPython Iterable subclassed by {name}. "
11421142
"Iterable is deprecated due to naming clash since v3.1.18"

0 commit comments

Comments
 (0)