Merge pull request #2202 from davidmann4/ci-fmt-skip-windows

ci: skip cargo fmt on the Windows lint leg (#2200)
This commit is contained in:
David Mann authored and GitHub committed 2026-11-18 13:33:00 +01:00
commit ccbc4b756c
2 files changed
+14 -4

No files matched your search

+6 -1
View File
@@ -64,7 +64,12 @@ jobs:
python3 scripts/test-workspace-concurrency.py
python3 scripts/test-workspace-tests.py
fi
cargo fmt --check
# One rustfmt call gets every source root of the workspace, which is longer than
# Windows allows for a command line (os error 206). rustfmt's result is the same on
# every system, so the Linux and macOS legs check it.
if [ "$RUNNER_OS" != Windows ]; then
cargo fmt --check
fi
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
command: |
+8 -3
View File
@@ -25,7 +25,9 @@ if [ "$RUNNER_OS" = Linux ]; then
python3 scripts/test-workspace-concurrency.py
python3 scripts/test-workspace-tests.py
fi
cargo fmt --check
if [ "$RUNNER_OS" != Windows ]; then
cargo fmt --check
fi
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
"""
@@ -96,11 +98,14 @@ TESTS = [
class WorkspaceTests(unittest.TestCase):
def test_every_leg_lints_with_both_feature_sets(self):
for os_name in ("Linux", "macOS", "Windows"):
# Windows skips only rustfmt: one call with every source root of the workspace is longer
# than a Windows command line may be (os error 206), and Linux and macOS check the same
# formatting.
for os_name, expected in (("Linux", COMMON), ("macOS", COMMON), ("Windows", COMMON[1:])):
with self.subTest(os=os_name):
result = commands(os_name, name="lint-command")
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(result.stdout.splitlines(), COMMON)
self.assertEqual(result.stdout.splitlines(), expected)
def test_linux_and_macos_run_one_feature_set_with_doctests(self):
for os_name in ("Linux", "macOS"):