Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit53b2567

Browse files
committed
fixing lints / noqa
1 parent23f616b commit53b2567

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

‎git/index/base.py

Lines 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_pathorself._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
withTemporaryFileSwap(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
returnindex
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
exceptGitCommandError:
13811381
# Without parsing stdout we don't know what failed.
1382-
raiseCheckoutError(
1382+
raiseCheckoutError(# 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

Lines 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
returnTrue
14501450
exceptException:
14511451
returnFalse

‎git/objects/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def _list_traverse(
439439

440440
ifnotas_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
returnout
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

Lines 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
returnFalse
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
returnFalse
515515
exceptTypeError:
516516
returnTrue

‎pyproject.toml

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp