Skip to content

Commit 9270340

Browse files
committed
chore: lint
1 parent f653965 commit 9270340

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/golf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
from golf.decorators import prompt, resource, tool
44

5-
__all__ = ["tool", "resource", "prompt"]
5+
__all__ = ["tool", "resource", "prompt"]

src/golf/core/parser.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ def _extract_explicit_name_from_decorator(
252252
func = decorator.func
253253

254254
# Check for @tool(...) pattern
255-
is_direct_decorator = (
256-
isinstance(func, ast.Name) and func.id == expected_decorator
257-
)
255+
is_direct_decorator = isinstance(func, ast.Name) and func.id == expected_decorator
258256

259257
# Check for @golf.tool(...) pattern
260258
is_qualified_decorator = (
@@ -268,9 +266,7 @@ def _extract_explicit_name_from_decorator(
268266
# Check for positional arg: @tool("name")
269267
if decorator.args:
270268
first_arg = decorator.args[0]
271-
if isinstance(first_arg, ast.Constant) and isinstance(
272-
first_arg.value, str
273-
):
269+
if isinstance(first_arg, ast.Constant) and isinstance(first_arg.value, str):
274270
return first_arg.value
275271
else:
276272
# Non-string or dynamic value
@@ -283,9 +279,7 @@ def _extract_explicit_name_from_decorator(
283279
# Check for keyword arg: @tool(name="name")
284280
for keyword in decorator.keywords:
285281
if keyword.arg == "name":
286-
if isinstance(keyword.value, ast.Constant) and isinstance(
287-
keyword.value.value, str
288-
):
282+
if isinstance(keyword.value, ast.Constant) and isinstance(keyword.value.value, str):
289283
return keyword.value.value
290284
else:
291285
# Non-string or dynamic value

0 commit comments

Comments
 (0)