mirror of
https://github.com/openai/codex.git
synced 2026-09-06 15:29:32 +00:00
## Why The root Python formatting pass only covered `scripts/`, leaving Python utilities elsewhere in the repository outside `just fmt` and `just fmt-check`. ## What changed - Run the scripts Ruff formatter from the repository root. - Exclude `sdk/python`, which has its own formatter pass, and `codex-rs/vendor`. - Apply Ruff formatting to the newly covered Python files and update the formatter coverage test. GitOrigin-RevId: 73ac82b8bb9c713d589724f6c4f926399febb513
44 lines
906 B
Python
Executable File
44 lines
906 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
|
|
from wrapper_common import (
|
|
build_final_args,
|
|
ensure_source_prerequisites,
|
|
exec_command,
|
|
parse_wrapper_args,
|
|
repo_root,
|
|
set_default_lint_env,
|
|
)
|
|
|
|
|
|
def main() -> "Never":
|
|
root = repo_root()
|
|
parsed = parse_wrapper_args(sys.argv[1:])
|
|
final_args = build_final_args(parsed, root / "codex-rs" / "Cargo.toml")
|
|
|
|
env = os.environ.copy()
|
|
ensure_source_prerequisites(env)
|
|
set_default_lint_env(env)
|
|
|
|
command = [
|
|
"cargo",
|
|
"dylint",
|
|
"--path",
|
|
str(root / "tools" / "argument-comment-lint"),
|
|
]
|
|
if not parsed.has_library_selection:
|
|
command.append("--all")
|
|
command.extend(final_args)
|
|
exec_command(command, env)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|