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

Commitb7ce712

Browse files
committed
Use newer ruff style
This updates `ruff` in `.pre-commit-config.yaml` from 0.6.0 to0.11.12, changes its `id` from the legacy `ruff` alias to`ruff-check` (which is better distinguished from `ruff-format`,which we also have a hook for), and applies the few style changesit newly recommends throughout the code. The style changes seem tomake things slightly clearer overall.This also updates some other pre-commit hooks, but those don'trequire any changes to the code.Currently the `ruff` dependency in `requirements-dev.txt` doesn'tspecify a version, so no change is needed there. This update maybe seen as bringing the `pre-commit` version in line with whatusers will usually have locally with `pip install -e ".[test]"`.The `pre-commit` hooks are how linting is currently done on CI, sothis is updating `ruff` for CI. That's the most significant effectof this change. (`pre-commit` is run for linting on CI probablymuch more often than it is used locally, to manage pre-commithooks or otherwise, in GitPython development.)
1 parent8576534 commitb7ce712

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

‎.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
-repo:https://github.com/codespell-project/codespell
3-
rev:v2.3.0
3+
rev:v2.4.1
44
hooks:
55
-id:codespell
66
additional_dependencies:[tomli]
77
exclude:^test/fixtures/
88

99
-repo:https://github.com/astral-sh/ruff-pre-commit
10-
rev:v0.6.0
10+
rev:v0.11.12
1111
hooks:
12-
-id:ruff
12+
-id:ruff-check
1313
args:["--fix"]
1414
exclude:^git/ext/
1515
-id:ruff-format
@@ -23,7 +23,7 @@ repos:
2323
exclude:^test/fixtures/polyglot$|^git/ext/
2424

2525
-repo:https://github.com/pre-commit/pre-commit-hooks
26-
rev:v4.6.0
26+
rev:v5.0.0
2727
hooks:
2828
-id:end-of-file-fixer
2929
exclude:^test/fixtures/|COPYING|LICENSE
@@ -33,6 +33,6 @@ repos:
3333
-id:check-merge-conflict
3434

3535
-repo:https://github.com/abravalheri/validate-pyproject
36-
rev:v0.19
36+
rev:v0.24.1
3737
hooks:
3838
-id:validate-pyproject

‎git/cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def pump_stream(
207207
)
208208
ifstderr_handler:
209209
error_str:Union[str,bytes]= (
210-
"error: process killed because it timed out."f" kill_after_timeout={kill_after_timeout} seconds"
210+
f"error: process killed because it timed out. kill_after_timeout={kill_after_timeout} seconds"
211211
)
212212
ifnotdecode_streamsandisinstance(p_stderr,BinaryIO):
213213
# Assume stderr_handler needs binary input.
@@ -1319,7 +1319,7 @@ def communicate() -> Tuple[AnyStr, AnyStr]:
13191319
out,err=proc.communicate()
13201320
watchdog.cancel()
13211321
ifkill_check.is_set():
1322-
err='Timeout: the command "%s" did not complete in %d'"secs."% (
1322+
err='Timeout: the command "%s" did not complete in %d secs.'% (
13231323
" ".join(redacted_command),
13241324
timeout,
13251325
)

‎git/refs/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def from_line(cls, line: bytes) -> "RefLogEntry":
126126
eliflen(fields)==2:
127127
info,msg=fields
128128
else:
129-
raiseValueError("Line must have up to two TAB-separated fields."" Got %s"%repr(line_str))
129+
raiseValueError("Line must have up to two TAB-separated fields. Got %s"%repr(line_str))
130130
# END handle first split
131131

132132
oldhexsha=info[:40]

‎git/repo/fun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def rev_parse(repo: "Repo", rev: str) -> AnyGitObject:
405405
# END end handle tag
406406
except (IndexError,AttributeError)ase:
407407
raiseBadName(
408-
f"Invalid revision spec '{rev}' - not enough"f"parent commits to reach '{token}{int(num)}'"
408+
f"Invalid revision spec '{rev}' - not enough parent commits to reach '{token}{int(num)}'"
409409
)frome
410410
# END exception handling
411411
# END parse loop

‎test/test_git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ def test_environment(self, rw_dir):
747747

748748
path=osp.join(rw_dir,"failing-script.sh")
749749
withopen(path,"wt")asstream:
750-
stream.write("#!/usr/bin/env sh\n""echo FOO\n")
750+
stream.write("#!/usr/bin/env sh\necho FOO\n")
751751
os.chmod(path,0o777)
752752

753753
rw_repo=Repo.init(osp.join(rw_dir,"repo"))

‎test/test_quick_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_cloned_repo_object(self, local_dir):
173173
# [15-test_cloned_repo_object]
174174
defprint_files_from_git(root,level=0):
175175
forentryinroot:
176-
print(f'{"-"*4*level}|{entry.path},{entry.type}')
176+
print(f"{'-'*4*level}|{entry.path},{entry.type}")
177177
ifentry.type=="tree":
178178
print_files_from_git(entry,level+1)
179179

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp