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

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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:

git/objects/submodule/base.py

Lines changed: 1 addition & 1 deletion
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

git/refs/log.py

Lines changed: 1 addition & 1 deletion
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

git/util.py

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy