From 5eb7c397fe46cdad4cd74241b03f51191a8cb275 Mon Sep 17 00:00:00 2001 From: Jerens Lensun <54782057+jerensl@users.noreply.github.com> Date: Fri, 4 Jul 2025 20:21:48 +0800 Subject: [PATCH] Merge`ruff.toml` into `pyproject.toml` (#37741) add a pyproject.toml config file that includes the settings for ruff --------- Signed-off-by: Jerens Lensun --- components/script_bindings/build.rs | 2 +- components/servo/build.rs | 2 +- mach | 2 +- mach.bat | 2 +- ruff.toml => pyproject.toml | 5 ++--- 5 files changed, 6 insertions(+), 7 deletions(-) rename ruff.toml => pyproject.toml (94%) diff --git a/components/script_bindings/build.rs b/components/script_bindings/build.rs index d2ff8ceb4a1..c28f900f6ce 100644 --- a/components/script_bindings/build.rs +++ b/components/script_bindings/build.rs @@ -87,7 +87,7 @@ impl phf_shared::PhfHash for Bytes<'_> { /// Note: This function should be kept in sync with the version in `components/script/build.rs` fn find_python() -> Command { let mut command = Command::new("uv"); - command.args(["run", "python"]); + command.args(["run", "--no-project", "python"]); if command.output().is_ok_and(|out| out.status.success()) { return command; diff --git a/components/servo/build.rs b/components/servo/build.rs index d610d1cfe36..b75866a6fdb 100644 --- a/components/servo/build.rs +++ b/components/servo/build.rs @@ -34,7 +34,7 @@ fn main() { /// Note: This function should be kept in sync with the version in `components/script/build.rs` fn find_python() -> Command { let mut command = Command::new("uv"); - command.args(["run", "python"]); + command.args(["run", "--no-project", "python"]); if command.output().is_ok_and(|out| out.status.success()) { return command; diff --git a/mach b/mach index 7d8fe738d36..f8add273e50 100755 --- a/mach +++ b/mach @@ -30,7 +30,7 @@ fi } - run_in_nix_if_needed uv run python ${MACH_DIR}/mach "$@" + run_in_nix_if_needed uv run --no-project python ${MACH_DIR}/mach "$@" } ''' diff --git a/mach.bat b/mach.bat index 4e0d273439c..4f2e1cd90f9 100644 --- a/mach.bat +++ b/mach.bat @@ -1,4 +1,4 @@ @echo off set workdir=%~dp0 -uv run python %workdir%mach %* +uv run --no-project python %workdir%mach %* diff --git a/ruff.toml b/pyproject.toml similarity index 94% rename from ruff.toml rename to pyproject.toml index 2bc8ee0f250..d6d76a26b70 100644 --- a/ruff.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ +[tool.ruff] line-length = 120 - extend-exclude = [ # temporary local files "target/**", @@ -12,13 +12,12 @@ extend-exclude = [ "tests/**", ] -[lint] +[tool.ruff.lint] select = [ "E", "W", "F", ] - ignore = [ # Trailing whitespace; the standard tidy process will enforce no trailing whitespace "W291",