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

Commitbdd6a43

Browse files
committed
Add type to symbolicreference.__repr__()
1 parent265d40b commitbdd6a43

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎git/refs/symbolic.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
__all__= ["SymbolicReference"]
3737

3838

39-
def_git_dir(repo,path):
39+
def_git_dir(repo:'Repo',path:PathLike)->PathLike:
4040
""" Find the git dir that's appropriate for the path"""
41-
name="%s"% (path,)
41+
name=f"{path}"
4242
ifnamein ['HEAD','ORIG_HEAD','FETCH_HEAD','index','logs']:
4343
returnrepo.git_dir
4444
returnrepo.common_dir
@@ -65,18 +65,18 @@ def __init__(self, repo: 'Repo', path: PathLike, check_path: bool = False):
6565
def__str__(self)->str:
6666
returnstr(self.path)
6767

68-
def__repr__(self):
68+
def__repr__(self)->str:
6969
return'<git.%s "%s">'% (self.__class__.__name__,self.path)
7070

71-
def__eq__(self,other):
71+
def__eq__(self,other:Any)->bool:
7272
ifhasattr(other,'path'):
7373
returnself.path==other.path
7474
returnFalse
7575

76-
def__ne__(self,other):
76+
def__ne__(self,other:Any)->bool:
7777
returnnot (self==other)
7878

79-
def__hash__(self):
79+
def__hash__(self)->int:
8080
returnhash(self.path)
8181

8282
@property

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ filterwarnings = 'ignore::DeprecationWarning'
1919
# filterwarnings ignore::WarningType # ignores those warnings
2020

2121
[tool.mypy]
22-
# disallow_untyped_defs =True
22+
# disallow_untyped_defs =true
2323
no_implicit_optional =true
2424
warn_redundant_casts =true
2525
# warn_unused_ignores = True

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp