Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa9298a

Browse filesBrowse files
committed
fixing lints / noqa
1 parent 0b7f159 commit aa9298a
Copy full SHA for aa9298a

File tree

5 files changed

+13
-15
lines changed
Filter options

5 files changed

+13
-15
lines changed

‎git/index/base.py

Copy file name to clipboardExpand all lines: git/index/base.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def write(
248248
# Make sure we have our entries read before getting a write lock.
249249
# Otherwise it would be done when streaming.
250250
# This can happen if one doesn't change the index, but writes it right away.
251-
self.entries
251+
self.entries # noqa: B018
252252
lfd = LockedFD(file_path or self._file_path)
253253
stream = lfd.open(write=True, stream=True)
254254

@@ -397,7 +397,7 @@ def from_tree(cls, repo: "Repo", *treeish: Treeish, **kwargs: Any) -> "IndexFile
397397
with TemporaryFileSwap(join_path_native(repo.git_dir, "index")):
398398
repo.git.read_tree(*arg_list, **kwargs)
399399
index = cls(repo, tmp_index)
400-
index.entries # Force it to read the file as we will delete the temp-file.
400+
index.entries # noqa: B018 # Force it to read the file as we will delete the temp-file.
401401
return index
402402
# END index merge handling
403403

@@ -1339,7 +1339,7 @@ def handle_stderr(proc: "Popen[bytes]", iter_checked_out_files: Iterable[PathLik
13391339
# Make sure we have our entries loaded before we start checkout_index, which
13401340
# will hold a lock on it. We try to get the lock as well during our entries
13411341
# initialization.
1342-
self.entries
1342+
self.entries # noqa: B018
13431343

13441344
args.append("--stdin")
13451345
kwargs["as_process"] = True
@@ -1379,7 +1379,7 @@ def handle_stderr(proc: "Popen[bytes]", iter_checked_out_files: Iterable[PathLik
13791379
self._flush_stdin_and_wait(proc, ignore_stdout=True)
13801380
except GitCommandError:
13811381
# Without parsing stdout we don't know what failed.
1382-
raise CheckoutError(
1382+
raise CheckoutError( # noqa: B904
13831383
"Some files could not be checked out from the index, probably because they didn't exist.",
13841384
failed_files,
13851385
[],

‎git/objects/submodule/base.py

Copy file name to clipboardExpand all lines: git/objects/submodule/base.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def exists(self) -> bool:
14451445

14461446
try:
14471447
try:
1448-
self.path
1448+
self.path # noqa: B018
14491449
return True
14501450
except Exception:
14511451
return False

‎git/objects/util.py

Copy file name to clipboardExpand all lines: git/objects/util.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def _list_traverse(
439439

440440
if not as_edge:
441441
out: IterableList[Union["Commit", "Submodule", "Tree", "Blob"]] = IterableList(id)
442-
out.extend(self.traverse(as_edge=as_edge, *args, **kwargs))
442+
out.extend(self.traverse(as_edge=as_edge, *args, **kwargs)) # noqa: B026
443443
return out
444444
# Overloads in subclasses (mypy doesn't allow typing self: subclass).
445445
# Union[IterableList['Commit'], IterableList['Submodule'], IterableList[Union['Submodule', 'Tree', 'Blob']]]

‎git/refs/symbolic.py

Copy file name to clipboardExpand all lines: git/refs/symbolic.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def is_valid(self) -> bool:
496496
valid object or reference.
497497
"""
498498
try:
499-
self.object
499+
self.object # noqa: B018
500500
except (OSError, ValueError):
501501
return False
502502
else:
@@ -510,7 +510,7 @@ def is_detached(self) -> bool:
510510
instead to another reference.
511511
"""
512512
try:
513-
self.ref
513+
self.ref # noqa: B018
514514
return False
515515
except TypeError:
516516
return True

‎pyproject.toml

Copy file name to clipboardExpand all lines: pyproject.toml
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,17 @@ lint.select = [
6767
# "UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
6868
]
6969
lint.extend-select = [
70-
"A", # see: https://pypi.org/project/flake8-builtins
70+
#"A", # see: https://pypi.org/project/flake8-builtins
7171
"B", # see: https://pypi.org/project/flake8-bugbear
7272
"C4", # see: https://pypi.org/project/flake8-comprehensions
7373
"TCH004", # see: https://docs.astral.sh/ruff/rules/runtime-import-in-type-checking-block/
7474
]
7575
lint.ignore = [
76-
"E203", "W503"
76+
"E203",
77+
"E731", # Do not assign a `lambda` expression, use a `def`
7778
]
7879
lint.ignore-init-module-imports = true
7980
lint.unfixable = ["F401"]
8081

81-
#[tool.ruff.lint.per-file-ignores]
82-
#"setup.py" = ["ANN202", "ANN401"]
83-
#"docs/source/conf.py" = ["A001", "D103"]
84-
#"src/**" = ["ANN401"]
85-
#"tests/**" = ["S101", "ANN001", "ANN201", "ANN202", "ANN401"]
82+
[tool.ruff.lint.per-file-ignores]
83+
"test/**" = ["B018"]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.