From a540933bc9c6ccdc5423c47a129c972c2edba678 Mon Sep 17 00:00:00 2001 From: konsti Date: Mon, 31 Jul 2023 14:45:38 +0200 Subject: [PATCH] Print log when formatter ecosystem checks fail (#6187) **Summary** Print the errors when the formatter ecosystem checks failed. Im not happy that we current collect the log in the first place, but this is the less invasive change and we need it to unblock reviewing #6152. **Test Plan** https://github.com/astral-sh/ruff/actions/runs/5713112075/job/15477879403?pr=6188 --- .../ruff_python_formatter/src/expression/expr_subscript.rs | 2 +- scripts/formatter_progress.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ruff_python_formatter/src/expression/expr_subscript.rs b/crates/ruff_python_formatter/src/expression/expr_subscript.rs index 9d5182dd2db8b..47089d2893eff 100644 --- a/crates/ruff_python_formatter/src/expression/expr_subscript.rs +++ b/crates/ruff_python_formatter/src/expression/expr_subscript.rs @@ -27,7 +27,7 @@ impl FormatNodeRule for FormatExprSubscript { let dangling_comments = comments.dangling_comments(item.as_any_node_ref()); debug_assert!( dangling_comments.len() <= 1, - "The subscript expression must have at most a single comment, the one after the bracket" + "A subscript expression can only have a single dangling comment, the one after the bracket" ); if let NodeLevel::Expression(Some(group_id)) = f.context().node_level() { diff --git a/scripts/formatter_progress.sh b/scripts/formatter_progress.sh index 088f8d56b27fa..b213a27fd9ea2 100755 --- a/scripts/formatter_progress.sh +++ b/scripts/formatter_progress.sh @@ -51,5 +51,9 @@ fi # for i in "$dir"/*/; do git -C "$i" switch main && git -C "$i" pull && echo "# $(basename "$i") $(git -C "$i" rev-parse HEAD)"; done time cargo run --bin ruff_dev -- format-dev --stability-check --error-file "$target/progress_projects_errors.txt" \ - --multi-project "$dir" >"$target/progress_projects_report.txt" + --multi-project "$dir" >"$target/progress_projects_report.txt" || ( + echo "Ecosystem check failed" + cat "$target/progress_projects_report.txt" + exit 1 +) grep "similarity index" "$target/progress_projects_report.txt" | sort