simvx.ide.lint.runner¶
Linting and formatting subprocess runner.
The commands are configurable (IDESection.lint_command /
format_command); the shipped defaults are ruff check and black.
Module Contents¶
Classes¶
Runs the configured lint and format commands and feeds diagnostics into State. |
Data¶
API¶
- simvx.ide.lint.runner.log¶
‘getLogger(…)’
- class simvx.ide.lint.runner.LintRunner(state: simvx.ide.state.State, config: simvx.ide.config.Config)[source]¶
Runs the configured lint and format commands and feeds diagnostics into State.
Initialization
- lint_file(path: str) list[simvx.ide.state.Diagnostic][source]¶
Run ruff check on path, parse JSON output, update state diagnostics.
- format_file(path: str) bool[source]¶
Run the configured formatter on path. Returns True when it stands.
The formatter rewrites the file in place, so its result is re-read before the rewrite is allowed to stand. A formatter may emit any syntax the interpreter accepts, and the parser scenes are loaded through accepts less than that:
ruff formatat target-version py314 rewritesexcept (A, B):as PEP 758except A, B:, which parso 0.8.7 cannot read, so a scene formatted on save keeps running and stops opening in the editor. When the result no longer parses, the file goes back to what it was and the refusal is reported as an error diagnostic, which is what puts it in the output panel.