Skip to content

Commit 2c3a638

Browse files
committed
Add python_version in pyrefly config
1 parent fb898c0 commit 2c3a638

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extensions/fine_python_pyrefly/fine_python_pyrefly/lint_handler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@dataclasses.dataclass
1414
class PyreflyLintHandlerConfig(code_action.ActionHandlerConfig):
15-
...
15+
python_version: str | None = None
1616

1717

1818
class PyreflyLintHandler(
@@ -104,9 +104,11 @@ async def run_pyrefly_lint_on_single_file(
104104
"--output-format=json",
105105
"--disable-search-path-heuristics=true",
106106
"--skip-interpreter-query",
107-
"--python-version='3.11'" # TODO
108107
]
109108

109+
if self.config.python_version is not None:
110+
cmd.append(f"--python-version='{self.config.python_version}'")
111+
110112
for path in site_package_pathes:
111113
cmd.append(f'--site-package-path={str(path)}')
112114
cmd.append(str(file_path))

0 commit comments

Comments
 (0)