Files
codex/tools/argument-comment-lint/test-with-clippy-compat.sh
T
Sean Huang a29c7b97e8 Fix argument comment lint tests after rust-clippy branch rename (#58013)
## Why

Dylint 6.1.0 still checks out rust-clippy's removed `master` branch.

## What changed

Run the argument comment lint package tests through a compatibility wrapper in both Rust CI workflows. The wrapper temporarily aliases rust-clippy's `main` branch to `master` using Git configuration scoped to that repository, preserves existing Git configuration entries, and forwards arguments to `cargo test`.

GitOrigin-RevId: 016d09c4ef71259f7d4eca4409f753bf66ae9e18
2026-10-29 07:41:19 +00:00

14 lines
623 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Dylint 6.1.0 still checks out rust-clippy's removed master branch. Add an
# alias only to that clone until we upgrade to a Dylint version that uses main.
clippy_config="$(mktemp)"
trap 'rm -f -- "$clippy_config"' EXIT
git config --file "$clippy_config" remote.origin.fetch '+refs/heads/main:refs/heads/master'
config_index="${GIT_CONFIG_COUNT:-0}"
export "GIT_CONFIG_KEY_${config_index}=includeIf.hasconfig:remote.*.url:https://github.com/rust-lang/rust-clippy.path"
export "GIT_CONFIG_VALUE_${config_index}=$clippy_config"
GIT_CONFIG_COUNT="$((config_index + 1))" cargo test "$@"