Skip to content

Tidy: detect ui tests subdirectory changes so tests/ui/README.md stays in sync - #150474

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
reddevilmidzy:tidy-sub-dir
Jan 29, 2026
Merged

Tidy: detect ui tests subdirectory changes so tests/ui/README.md stays in sync#150474
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
reddevilmidzy:tidy-sub-dir

Conversation

@reddevilmidzy

@reddevilmidzyreddevilmidzy commented Dec 29, 2025

Copy link
Copy Markdown
Member

close: #150399

There's an issue where tests/ui/README.md isn't updated whenever the ui subdirectory changes.
I've added subdirectory change detection to tidy added a new mention to triage.toml to notify tests/ui/README.md to also be updated.

r? @Urgau

@rustbot

Copy link
Copy Markdown
Collaborator

triagebot.toml has been modified, there may have been changes to the review queue.

cc @davidtwco, @wesleywiser

@rustbotrustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 29, 2025
Comment threadsrc/tools/tidy/src/ui_tests.rs Outdated
Comment threadsrc/tools/tidy/src/ui_tests.rs Outdated
Comment threadsrc/tools/tidy/src/ui_tests.rs Outdated
Comment threadtriagebot.toml Outdated
Comment threadsrc/tools/tidy/src/ui_tests.rs Outdated
Comment threadsrc/tools/tidy/src/ui_tests.rs Outdated
Comment threadsrc/tools/tidy/src/ui_tests.rs Outdated
@Urgau

Copy link
Copy Markdown
Member

Looks good to me, but I will let the final review to a T-bootstrap member.

Btw, could you make the title and description a bit more descriptive.

r? bootstrap

@rustbotrustbot assigned Zalathar and unassigned UrgauDec 29, 2025
@reddevilmidzyreddevilmidzy changed the title Add subdirectory change detection to tidyTidy: detect subdirectory changes so tests/ui/README.md stays in syncDec 30, 2025
@reddevilmidzy

Copy link
Copy Markdown
MemberAuthor

Okay, thank you for the review:)

@reddevilmidzyreddevilmidzy changed the title Tidy: detect subdirectory changes so tests/ui/README.md stays in syncTidy: detect ui tests subdirectory changes so tests/ui/README.md stays in syncDec 30, 2025
@Zalathar

Copy link
Copy Markdown
Member

I don't quite understand the purpose of having a separate ui_suites.txt.

If the goal is to keep tests/ui/README.md in sync with the subdirectories, wouldn't it make more sense to compare the list of subdirectories to the list of headings in the readme?

@reddevilmidzy

reddevilmidzy commented Dec 30, 2025

Copy link
Copy Markdown
MemberAuthor

I don't quite understand the purpose of having a separate ui_suites.txt.

If the goal is to keep tests/ui/README.md in sync with the subdirectories, wouldn't it make more sense to compare the list of subdirectories to the list of headings in the readme?

Ah, since the initial suggestion was to "add comments when subdirectories change," so we implemented it by creating a ui_suites.txt file so that triagebot could leave comments.

If we wanted to include directory change detection in tidy and force modifications to tests/ui/README.md, comparing the subtitles of tests/ui/README.md would be a better approach, as you suggested.

I will change it.

@Urgau

Copy link
Copy Markdown
Member

I don't quite understand the purpose of having a separate ui_suites.txt.

If the goal is to keep tests/ui/README.md in sync with the subdirectories, wouldn't it make more sense to compare the list of subdirectories to the list of headings in the readme?

Parsing a Markdown file is non-trivial and tidy currently doesn't have a dependency on pulldown-cmark. I'm not sure we would want to add such dependency to tidy, so we would have to approximate it.

But in general yes, looking at tests/ui/README.md is probably better.

@Zalathar

Copy link
Copy Markdown
Member

Given that this is an in-tree tidy check for a single file that we already control, I don't think we need to actually parse Markdown.

We can just assume that tests/ui/README.md will be written in a predictable style, and use a relatively-simple regex to extract directory names from lines that start with ##.

If somebody tries to modify the readme in a way that would break the tidy check, well, maybe they shouldn't be doing that.

@Zalathar

Copy link
Copy Markdown
Member

@rustbot author

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 2, 2026
@reddevilmidzy
reddevilmidzyforce-pushed the tidy-sub-dir branch 2 times, most recently from 7f0149f to 4bbba21CompareJanuary 2, 2026 11:16
@rustbot

This comment has been minimized.

@reddevilmidzy

Copy link
Copy Markdown
MemberAuthor

Unified by removing '/' at the end of the title and added directories that did not have descriptions.

created:

tidy [ui_tests (tests)]: ui subdirectory `tests/ui/annotate-moves` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/any` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/collections` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/deref` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/dist` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/eii` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/float` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/fn_traits` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/higher-ranked-trait-bounds` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/loop-match` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/offload` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/pin` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/pin-ergonomics` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/reborrow` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/rust-2018` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/rust-2021` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/rust-2024` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/sanitize-attr` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/scalable-vectors` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/sized-hierarchy` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/stack-probes` created
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/unstable-feature-bound` created

deleted

tidy [ui_tests (tests)]: ui subdirectory `tests/ui/rust-{2018,2021,2024}` deleted
tidy [ui_tests (tests)]: ui subdirectory `tests/ui/typeof` deleted

thank you for the review:)
@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 2, 2026
@reddevilmidzy

Copy link
Copy Markdown
MemberAuthor

Ah, I will add a task to check the alignment. @rustbot author

@rustbot

This comment has been minimized.

Comment threadtests/ui/README.md
Comment on lines +1199 to +1204
## `tests/ui/reflection/`

Exercises the `#![feature(type_info)]` feature.

See [Tracking Issue for type_info #146922](https://github.com/rust-lang/rust/issues/146922)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory was also added within two weeks.😄

@reddevilmidzy

Copy link
Copy Markdown
MemberAuthor

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2026
@Zalathar

Copy link
Copy Markdown
Member

Nitpick: Could you please reorder the commits, so that the readme changes come before adding the tidy check?

That way, every individual commit should successfully pass tests, which is a nice property to have.

After that, I think we should be good to go.

@rustbot author

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 28, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@reddevilmidzyreddevilmidzy left a comment

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review! @Zalathar

@rustbot ready

View changes since this review

Comment threadtests/ui/README.md
Comment on lines +1477 to +1480
## `tests/ui/trimmed-paths/`

Tests for the `#[doc(hidden)]` items.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rearranged the commit order and added this section,

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 28, 2026
@Zalathar

Copy link
Copy Markdown
Member

Thanks for your patience. 🙌

@bors r+

@rust-bors

rust-borsBot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a085410 has been approved by Zalathar

It is now in the queue for this repository.

@rust-borsrust-borsBot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 29, 2026
…thar
Tidy: detect ui tests subdirectory changes so `tests/ui/README.md` stays in sync
close: rust-lang#150399
There's an issue where `tests/ui/README.md` isn't updated whenever the ui subdirectory changes.
I've added subdirectory change detection to tidy ~~added a new mention to `triage.toml` to notify `tests/ui/README.md` to also be updated~~.
r? @Urgau
@ZalatharZalathar mentioned this pull request Jan 29, 2026
rust-borsBot pushed a commit that referenced this pull request Jan 29, 2026
Rollup of 8 pull requests
Successful merges:
- #150474 (Tidy: detect ui tests subdirectory changes so `tests/ui/README.md` stays in sync)
- #150572 (Improve move error diagnostic for `AsyncFn` closures)
- #151596 (Fix -Zmir-enable-passes to detect unregistered enum names in declare_passes macro)
- #151802 (Make `QueryDispatcher::Qcx` an associated type)
- #151559 ([rustdoc] Add a marker to tell users that there are hidden (deprecated) items in the search results)
- #151665 (Fix contrast ratio for `Since` element in rustodoc dark theme)
- #151798 (Update `askama` to `0.15.3`)
- #151800 (Subscribe myself to translation diagnostics)
@ZalatharZalathar mentioned this pull request Jan 29, 2026
rust-borsBot pushed a commit that referenced this pull request Jan 29, 2026
Rollup of 12 pull requests
Successful merges:
- #150474 (Tidy: detect ui tests subdirectory changes so `tests/ui/README.md` stays in sync)
- #150572 (Improve move error diagnostic for `AsyncFn` closures)
- #151596 (Fix -Zmir-enable-passes to detect unregistered enum names in declare_passes macro)
- #151802 (Make `QueryDispatcher::Qcx` an associated type)
- #149110 (Implement `cast_slice` for raw pointer types)
- #151559 ([rustdoc] Add a marker to tell users that there are hidden (deprecated) items in the search results)
- #151665 (Fix contrast ratio for `Since` element in rustdoc dark theme)
- #151785 (Stabilize feature(push_mut))
- #151798 (Update `askama` to `0.15.3`)
- #151800 (Subscribe myself to translation diagnostics)
- #151804 (Document, sort, and tweak spellcheck entries in `typos.toml`)
- #151805 (Fix grammar in `env::current_exe()#Security`)
@rust-bors
rust-borsBot merged commit dd43c88 into rust-lang:mainJan 29, 2026
11 checks passed
@rustbotrustbot added this to the 1.95.0 milestone Jan 29, 2026
rust-timer added a commit that referenced this pull request Jan 29, 2026
Rollup merge of #150474 - reddevilmidzy:tidy-sub-dir, r=Zalathar
Tidy: detect ui tests subdirectory changes so `tests/ui/README.md` stays in sync
close: #150399
There's an issue where `tests/ui/README.md` isn't updated whenever the ui subdirectory changes.
I've added subdirectory change detection to tidy ~~added a new mention to `triage.toml` to notify `tests/ui/README.md` to also be updated~~.
r? @Urgau
@reddevilmidzy
reddevilmidzy deleted the tidy-sub-dir branch January 29, 2026 11:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-metaArea: Issues & PRs about the rust-lang/rust repository itselfA-tidyArea: The tidy toolS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comment when new directory is added to tests/ui

4 participants

@reddevilmidzy@rustbot@Urgau@Zalathar