Skip to content

Commit 55878c5

Browse files
committed
fix(parser,git): Fix critical typing bug with matchers
1 parent 3936e44 commit 55878c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libvcs/parse/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def register(self, cls: Matcher) -> None:
123123
>>> from libvcs.parse.git import DEFAULT_MATCHERS, PIP_DEFAULT_MATCHERS
124124
125125
>>> class GitURLWithPip(GitBaseURL):
126-
... matchers = MatcherRegistry = MatcherRegistry(
126+
... matchers: MatcherRegistry = MatcherRegistry(
127127
... _matchers={m.label: m for m in [*DEFAULT_MATCHERS, *PIP_DEFAULT_MATCHERS]}
128128
... )
129129

libvcs/parse/git.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class GitBaseURL(URLProtocol, SkipDefaultFieldsReprMixin):
259259
suffix: Optional[str] = None
260260

261261
matcher: Optional[str] = None
262-
matchers = MatcherRegistry = MatcherRegistry(
262+
matchers: MatcherRegistry = MatcherRegistry(
263263
_matchers={m.label: m for m in DEFAULT_MATCHERS}
264264
)
265265

@@ -368,7 +368,7 @@ class GitPipURL(GitBaseURL, URLProtocol, SkipDefaultFieldsReprMixin):
368368
# commit-ish (rev): tag, branch, ref
369369
rev: Optional[str] = None
370370

371-
matchers = MatcherRegistry = MatcherRegistry(
371+
matchers: MatcherRegistry = MatcherRegistry(
372372
_matchers={m.label: m for m in PIP_DEFAULT_MATCHERS}
373373
)
374374

@@ -478,7 +478,7 @@ class GitURL(GitPipURL, GitBaseURL, URLProtocol, SkipDefaultFieldsReprMixin):
478478
- :meth:`GitBaseURL.to_url`
479479
"""
480480

481-
matchers = MatcherRegistry = MatcherRegistry(
481+
matchers: MatcherRegistry = MatcherRegistry(
482482
_matchers={m.label: m for m in [*DEFAULT_MATCHERS, *PIP_DEFAULT_MATCHERS]}
483483
)
484484

0 commit comments

Comments
 (0)