Skip to content

Commit

Permalink
ci: resolve ruff check F405
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek authored and kszucs committed Oct 5, 2024
1 parent a2ce7aa commit 3a81057
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions koerce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from ._internal import * # noqa: F403


class _Variable(Deferred):
class _Variable(Deferred): #noqa: F405
def __init__(self, name: str):
builder = Var(name)
builder = Var(name) # noqa: F405
super().__init__(builder)

def __pos__(self):
return Capture(self)
return Capture(self) # noqa: F405

def __neg__(self):
return self
Expand Down Expand Up @@ -50,16 +50,16 @@ def var(name):


def namespace(module):
p = _Namespace(pattern, module)
d = _Namespace(deferred, module)
p = _Namespace(pattern, module) # noqa: F405
d = _Namespace(deferred, module) # noqa: F405
return p, d


def replace(matcher):
"""More convenient syntax for replacing a value with the output of a function."""

def decorator(replacer):
return Replace(matcher, replacer)
return Replace(matcher, replacer) # noqa: F405

return decorator

Expand All @@ -72,8 +72,8 @@ def __init__(self):


def koerce(
pat: Pattern, value: Any, context: Context = None, allow_coercion: bool = False
) -> Any:
pat: Pattern, value: Any, context: Context = None, allow_coercion: bool = False # noqa: F405
) -> Any: # noqa: F405
"""Match a value against a pattern.
Parameters
Expand Down Expand Up @@ -106,10 +106,10 @@ def koerce(
... ]
"""
pat = pattern(pat, allow_coercion=allow_coercion)
pat = pattern(pat, allow_coercion=allow_coercion) # noqa: F405
try:
return pat.apply(value, context)
except MatchError:
except MatchError: # noqa: F405
return NoMatch


Expand Down

0 comments on commit 3a81057

Please sign in to comment.