Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c861b6b
ci(test): remove dead mingw PATH workflow steps
jieyouxu Nov 2, 2026
e5cfe3c
Merge pull request #7228 from jieyouxu/jieyouxu/fix-ci
ytmimi Nov 3, 2026
0baba0a
Allow reading args from `@path`
matthewhughes934 Oct 28, 2026
e4d6867
Merge pull request #7220 from matthewhughes934/args-from-path
ytmimi Nov 5, 2026
5288ba8
Add pre-fix tests for rust-lang/rustfmt#6612
matthewhughes934 Nov 4, 2026
727dbd5
Add additional test case which errored with trailing whitespace
jieyouxu Nov 6, 2026
429bb51
Add style edition 2021 regression test
jieyouxu Nov 6, 2026
be03998
Derive Debug for `comment::CommentStyle`
ytmimi Jun 20, 2022
aead0f9
Remove each comment's leading whitespace in `comment::rewrite_comment`
ytmimi Jun 20, 2022
774c6dc
Merge pull request #5392 from ytmimi/issue_5391
jieyouxu Nov 6, 2026
20e71c2
test: cover empty where clauses across style editions
mu001999 Nov 6, 2026
b574386
fix: remove uncommented empty where clauses after return types
mu001999 Nov 6, 2026
56eb832
feat: add icu4x and all unicode-rs repo to check_diff
SzilvasiPeter Nov 6, 2026
59233d7
Merge pull request #7236 from SzilvasiPeter/main
ytmimi Nov 6, 2026
9e1bd47
Add regression tests for trailing multiline block comments
randomPoison Nov 5, 2026
7af0cb9
Fix trailing multiline block comments while preserving older style ed…
randomPoison Nov 5, 2026
2c09421
docs: add TL;DR LLM usage policy to contributing docs
jieyouxu Nov 7, 2026
671e1dd
docs: move linting section slightly below
jieyouxu Nov 7, 2026
ba6ce2f
Merge pull request #7217 from randomPoison/iss-6339-broken-multi-line…
jieyouxu Nov 7, 2026
b44d2fc
Merge pull request #6167 from mu001999-contrib/master
jieyouxu Nov 7, 2026
d89e754
docs: add fuzzing guidelines to contributing docs
jieyouxu Nov 7, 2026
d73a51b
docs: add a TOC to contributing docs
jieyouxu Nov 7, 2026
f02cae1
docs: describe PR lifecycle in contributing docs
jieyouxu Nov 7, 2026
5245505
Merge pull request #7237 from jieyouxu/jieyouxu/contrib-docs
jieyouxu Nov 7, 2026
b272a96
test: rework `--print-config current` tests and add #[nightly_only_te…
ytmimi Nov 10, 2026
4108208
Merge pull request #7240 from rust-lang/prevent_tests_from_running_in…
ytmimi Nov 10, 2026
589d998
Don't split link destinations when wrap_comments is enabled
AlexeyL54 Oct 19, 2026
a230a9d
Merge pull request #7197 from AlexeyL54/comment-7177-dont-split-link-…
jieyouxu Nov 13, 2026
df4a692
test: snapshot current whitespace before a skipped impl item
shulaoda Nov 14, 2026
19bbac1
tests: fix up some line endings
matthewhughes934 Oct 31, 2026
de113ab
system/idempotence tests: also assert on line endings
matthewhughes934 Oct 31, 2026
d47bc96
Merge pull request #7233 from matthewhughes934/eol-testing
jieyouxu Nov 14, 2026
cbb4ecb
Fix idempotency issue with raw strings
shulaoda Aug 1, 2026
0f686ae
test: add regression test for issue 4003
ytmimi Nov 15, 2026
71840ed
test: add regression test for issue 4844
ytmimi Nov 15, 2026
dd265a0
test: add regression test for issue 4575
ytmimi Nov 15, 2026
c385056
test: add regression test for issue 5373
ytmimi Nov 15, 2026
2dc2473
test: add regression test for issue 5465
ytmimi Nov 15, 2026
4fef4cd
test: add regression test for issue 6016
ytmimi Nov 15, 2026
ee069a4
test: add regression test for issue 4804
ytmimi Nov 15, 2026
8d94490
Merge pull request #7248 from ytmimi/regression_tests
ytmimi Nov 16, 2026
354bd1b
Merge pull request #6696 from shulaoda/10-11-fix-idempotency-issue-wi…
jieyouxu Nov 16, 2026
f4b11ea
fix: don't leave trailing whitespace before a skipped impl item
shulaoda Jul 25, 2026
3dfd148
Merge pull request #6979 from shulaoda/07-26-fix_don_t_leave_trailing…
jieyouxu Nov 16, 2026
8c84d1e
refactor: consistently use "Diff Check"
jieyouxu Nov 17, 2026
afb52e8
ci: explicitly install rust toolchain
jieyouxu Nov 17, 2026
5c54218
Merge pull request #7251 from rust-lang/jieyouxu/cleanup/diff-check
ytmimi Nov 17, 2026
9b97ed9
Merge pull request #7252 from jieyouxu/jieyouxu/ci/rustup
ytmimi Nov 17, 2026
7a89c4d
refactor: extract common workflow for diff check
jieyouxu Nov 17, 2026
dc2c67a
fix: use double-quote for non-option args to prevent globbing and wor…
jieyouxu Nov 17, 2026
9766cac
fix: use bash array instead of plain string concats
jieyouxu Nov 17, 2026
006f599
fix: actually respect release channel option
jieyouxu Nov 17, 2026
0a75d45
ci: prepare optional matrix job artifact upload
jieyouxu Nov 17, 2026
2f1cbd5
ci: add preset workflow for Edition {2021,2024} x Style Edition {2021…
jieyouxu Nov 17, 2026
34141af
Merge pull request #7253 from jieyouxu/jieyouxu/ci/diff-check-preset
ytmimi Nov 17, 2026
260ba2f
Prepare for merging from rust-lang/rust
jieyouxu Nov 18, 2026
dbf9c83
Merge ref '59cbdee2e7b3' (nightly-2026-11-18) from rust-lang/rust
jieyouxu Nov 18, 2026
33f606d
Merge pull request #7255 from rust-lang/subtree-pull-20261118
ytmimi Nov 18, 2026
3bfcc4f
fix: use `CARGO_MANIFEST_DIR` to conjure a predictable absolute path
jieyouxu Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/tools/rustfmt/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
* text=auto eol=lf
tests/source/issue-3494/crlf.rs -text
tests/source/comment_crlf_newline.rs -text
tests/source/configs/enum_discrim_align_threshold/40.rs -text
tests/target/issue-3494/crlf.rs -text
tests/target/comment_crlf_newline.rs -text
tests/target/configs/enum_discrim_align_threshold/40.rs -text

tests/target/format_strings/issue-3263.rs -text
tests/target/issue-3265.rs -text
tests/target/issue-2810.rs -text
tests/target/issue-2728.rs -text
tests/target/issue-2641.rs -text
tests/target/preserves_carriage_return_for_windows.rs -text
86 changes: 0 additions & 86 deletions src/tools/rustfmt/.github/workflows/check_diff.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
matrix:
package:
- . # rustfmt
- check_diff
- ci
- config_proc_macro
- diff_check
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
58 changes: 58 additions & 0 deletions src/tools/rustfmt/.github/workflows/diff_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Diff Check (Custom)
on:
workflow_dispatch:
inputs:
clone_url:
description: 'Git url of a rustfmt fork to compare against the latest rustfmt'
required: true
branch_name:
description: 'Name of the feature branch on the forked repo'
required: true
language_edition:
description: 'Rust language `edition` used to parse code'
required: true
default: 2015
type: choice
options:
- 2015
- 2018
- 2021
- 2024
style_edition:
description: 'rustfmt `style_edition` used when formatting code.'
required: true
default: 2021
type: choice
options:
- 2021 # 2015, 2018, and 2021 are all formatted the same since `style_edition` was added between 2021 and 2024
- 2024
commit_hash:
description: 'Optional commit hash from the feature branch'
required: false
rustfmt_configs:
description: 'Optional comma separated list of rustfmt config options to pass when running the feature branch'
required: false
release_channel:
description: 'Configure which release channel to use when compiling rustfmt'
default: stable
type: choice
options:
- stable
- beta
- nightly

permissions:
contents: read

jobs:
diff_check:
name: "Diff Check {Edition ${{ inputs.language_edition }}, Style Edition ${{ inputs.style_edition }}}"
uses: $/.github/workflows/diff_check_common.yml
with:
clone_url: ${{ inputs.clone_url }}
branch_name: ${{ inputs.branch_name }}
language_edition: ${{ inputs.language_edition }}
style_edition: ${{ inputs.style_edition }}
commit_hash: ${{ inputs.commit_hash }}
rustfmt_configs: ${{ inputs.rustfmt_configs }}
release_channel: ${{ inputs.release_channel }}
106 changes: 106 additions & 0 deletions src/tools/rustfmt/.github/workflows/diff_check_common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Diff Check (Common)
on:
workflow_call:
inputs:
clone_url:
description: 'Git url of a rustfmt fork to compare against the latest rustfmt'
type: string
required: true
branch_name:
description: 'Name of the feature branch on the forked repo'
type: string
required: true
language_edition:
description: 'Rust language `edition` used to parse code'
type: string
required: true
style_edition:
description: 'rustfmt `style_edition` used when formatting code.'
type: string
required: true
commit_hash:
description: 'Optional commit hash from the feature branch'
type: string
required: false
rustfmt_configs:
description: 'Optional comma separated list of rustfmt config options to pass when running the feature branch'
type: string
required: false
release_channel:
description: 'Configure which release channel to use when compiling rustfmt'
type: string
required: false
default: stable
result_artifact:
description: 'Upload job status as an artifact with the given name (if set)'
type: string
required: false
default: ''

permissions:
contents: read

jobs:
diff_check:
name: "Diff Check {Edition ${{ inputs.language_edition }}, Style Edition ${{ inputs.style_edition }}}"
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Build diff_check binary
working-directory: ./diff_check
run: cargo build --release --locked

- name: Run Diff Check
working-directory: ./diff_check
env:
DIFF_CHECK_LOG: info
GITHUB_EVENT_INPUTS_COMMIT_HASH: ${{ inputs.commit_hash }}
GITHUB_EVENT_INPUTS_RUSTFMT_CONFIGS: ${{ inputs.rustfmt_configs }}
GITHUB_EVENT_INPUTS_CLONE_URL: ${{ inputs.clone_url }}
GITHUB_EVENT_INPUTS_BRANCH_NAME: ${{ inputs.branch_name }}
GITHUB_EVENT_INPUTS_LANGUAGE_EDITION: ${{ inputs.language_edition }}
GITHUB_EVENT_INPUTS_STYLE_EDITION: ${{ inputs.style_edition }}
GITHUB_EVENT_INPUTS_RELEASE_CHANNEL: ${{ inputs.release_channel }}
shell: bash
run: |
OPTIONS=()

if [[ -n "${GITHUB_EVENT_INPUTS_COMMIT_HASH}" ]]; then
OPTIONS+=(--commit-hash "${GITHUB_EVENT_INPUTS_COMMIT_HASH}")
fi

if [[ -n "${GITHUB_EVENT_INPUTS_RUSTFMT_CONFIGS}" ]]; then
OPTIONS+=(--rustfmt-config "${GITHUB_EVENT_INPUTS_RUSTFMT_CONFIGS}")
fi

target/release/diff_check \
"${GITHUB_EVENT_INPUTS_CLONE_URL}" \
"${GITHUB_EVENT_INPUTS_BRANCH_NAME}" \
--edition "${GITHUB_EVENT_INPUTS_LANGUAGE_EDITION}" \
--style-edition "${GITHUB_EVENT_INPUTS_STYLE_EDITION}" \
--release-channel "${GITHUB_EVENT_INPUTS_RELEASE_CHANNEL}" \
"${OPTIONS[@]}"

# A matrix of reusable workflow jobs give only one combined outcome, so we
# need to track outcome of individual matrix jobs.
- name: Record result
if: ${{ always() && inputs.result_artifact != '' }}
env:
JOB_STATUS: ${{ job.status }}
run: echo "${JOB_STATUS}" > "${RUNNER_TEMP}/result.txt"

- name: Upload result
if: ${{ always() && inputs.result_artifact != '' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ inputs.result_artifact }}
path: ${{ runner.temp }}/result.txt
retention-days: 1
# Allow overwriting so that rerunning a matrix job can upload artifact
# with same name.
overwrite: true
105 changes: 105 additions & 0 deletions src/tools/rustfmt/.github/workflows/diff_check_preset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Diff Check (Preset)
on:
workflow_dispatch:
inputs:
clone_url:
description: 'Git url of a rustfmt fork to compare against the latest rustfmt'
required: true
branch_name:
description: 'Name of the feature branch on the forked repo'
required: true
commit_hash:
description: 'Optional commit hash from the feature branch'
required: false
rustfmt_configs:
description: 'Optional comma separated list of rustfmt config options to pass when running the feature branch'
required: false
release_channel:
description: 'Configure which release channel to use when compiling rustfmt'
default: stable
type: choice
options:
- stable
- beta
- nightly

permissions:
contents: read

jobs:
diff_check:
name: "Diff Check {Edition ${{ matrix.language_edition }}, Style Edition ${{ matrix.style_edition }}}"
strategy:
# We want to run each matrix job to conclusion so we get a full table.
fail-fast: false
# By default, we want to run Diff Check against Edition `{CURRENT - 1,
# CURRENT}` x Style Edition `{CURRENT - 1, CURRENT}` as a preset.
#
# Update the matrix once a new language edition / new style edition is
# stable. Keep in sync with "Write summary" step below.
matrix:
language_edition: ['2021', '2024']
style_edition: ['2021', '2024']
uses: $/.github/workflows/diff_check_common.yml
with:
clone_url: ${{ inputs.clone_url }}
branch_name: ${{ inputs.branch_name }}
commit_hash: ${{ inputs.commit_hash }}
language_edition: ${{ matrix.language_edition }}
style_edition: ${{ matrix.style_edition }}
rustfmt_configs: ${{ inputs.rustfmt_configs }}
release_channel: ${{ inputs.release_channel }}
result_artifact: diff-check-result-ed${{ matrix.language_edition }}-se${{ matrix.style_edition }}

summary:
name: "Render Diff Check matrix summary"
needs: diff_check
if: ${{ always() }}
runs-on: ubuntu-latest

steps:
- name: Download results
# Note that no artifact exists if all matrix jobs were cancelled early.
continue-on-error: true
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: diff-check-result-*
path: ${{ runner.temp }}/results

- name: Write summary
env:
CLONE_URL: ${{ inputs.clone_url }}
BRANCH_NAME: ${{ inputs.branch_name }}
COMMIT_HASH: ${{ inputs.commit_hash }}
RUSTFMT_CONFIGS: ${{ inputs.rustfmt_configs }}
RELEASE_CHANNEL: ${{ inputs.release_channel }}
shell: bash
run: |
results_dir="${RUNNER_TEMP}/results"
{
echo "## Diff Check (Preset)"
echo
echo "- Repo: \`${CLONE_URL}\`"
echo "- Branch: \`${BRANCH_NAME}\`"
echo "- Commit: \`${COMMIT_HASH:-branch tip}\`"
echo "- Release channel: \`${RELEASE_CHANNEL}\`"
echo "- rustfmt configs: \`${RUSTFMT_CONFIGS:-none}\`"
echo
echo "| Language Edition | Style Edition | Result |"
echo "|---|---|---|"
# Keep in sync with the `diff_check` matrix.
for language_edition in 2021 2024; do
for style in 2021 2024; do
file="${results_dir}/diff-check-result-ed${language_edition}-se${style}/result.txt"
status=""
[[ -f "${file}" ]] && status=$(< "${file}")
case "${status}" in
success) result="✅" ;;
failure) result="❌" ;;
cancelled) result="CANCELLED" ;;
*) result="NO RESULT" ;;
esac
echo "| ${language_edition} | ${style} | ${result} |"
done
done
} >> "${GITHUB_STEP_SUMMARY}"
1 change: 1 addition & 0 deletions src/tools/rustfmt/.github/workflows/rustdoc_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup toolchain install
rustup target add x86_64-unknown-linux-gnu

- name: document rustfmt
Expand Down
Loading
Loading