Skip to content

add ruff rules and fix tests #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 29, 2025
Merged
17 changes: 16 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ exclude = [
]
unsafe-fixes = true
[lint]
select = ["F", "E", "W", "I", "UP", "D", "RUF", "DTZ", "TC", "EM", "TRY400"]
select = [
"F",
"E",
"W",
"I",
"UP",
"D",
"YTT",
"RUF",
"DTZ",
"TC",
"EM",
"TRY400",
]
ignore = [
"D100",
"D101",
Expand Down Expand Up @@ -216,3 +229,5 @@ extend-generics = [
]
[lint.isort]
known-first-party = ["codegen"]
[format]
docstring-code-format = true
2 changes: 1 addition & 1 deletion src/codegen/sdk/core/detached_symbols/function_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FunctionCall(Expression[Parent], HasName, Resolvable, Generic[Parent]):
"""Abstract representation of a function invocation, e.g. in Python:
```
def f():
g() # FunctionCall
g() # FunctionCall
```
"""

Expand Down
1 change: 1 addition & 0 deletions src/codegen/sdk/core/import_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ def is_dynamic(self) -> bool:
def my_function():
import foo # Dynamic - only imported when function runs


if condition:
from bar import baz # Dynamic - only imported if condition is True

Expand Down