Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion symforce/codegen/codegen_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ def generate_lcm_types(
)

# Autoformat generated python files
format_util.format_py_dir(python_types_dir)
for f in python_types_dir.rglob("*.py"):
f.write_text(format_util.format_py(f.read_text(), str(Path(__file__).parent / f.name)))

return result

Expand Down
15 changes: 0 additions & 15 deletions symforce/codegen/format_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,6 @@ def format_py(file_contents: str, filename: str) -> str:
return result.stdout


def format_py_dir(dirname: T.Openable) -> None:
"""
Autoformat python files in a directory (recursively) in-place
"""
subprocess.run(
[find_ruff_bin(), "format", dirname],
check=True,
# Disable the ruff cache. This is important for running in a hermetic context like a bazel
# test, and shouldn't really hurt other use cases. If it does, we should work around this
# differently.
env=dict(os.environ, RUFF_NO_CACHE="true"),
text=True,
)


_rustfmt_path: T.Optional[Path] = None


Expand Down
Loading