Skip to content

Conversation

@reddevilmidzy
Copy link
Member

@reddevilmidzy reddevilmidzy commented Dec 29, 2025

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
Collaborator

rustbot commented Dec 29, 2025

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

cc @davidtwco, @wesleywiser

@rustbot rustbot 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
@Urgau
Copy link
Member

Urgau commented Dec 29, 2025

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

@rustbot rustbot assigned Zalathar and unassigned Urgau Dec 29, 2025
@reddevilmidzy reddevilmidzy changed the title Add subdirectory change detection to tidy Tidy: detect subdirectory changes so tests/ui/README.md stays in sync Dec 30, 2025
@reddevilmidzy
Copy link
Member Author

Okay, thank you for the review:)

@reddevilmidzy reddevilmidzy changed the title Tidy: detect subdirectory changes so tests/ui/README.md stays in sync Tidy: detect ui tests subdirectory changes so tests/ui/README.md stays in sync Dec 30, 2025
@Zalathar
Copy link
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
Copy link
Member Author

reddevilmidzy commented Dec 30, 2025

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
Member

Urgau commented Dec 30, 2025

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
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
Member

Zalathar commented Jan 2, 2026

@rustbot author

@rustbot rustbot 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant 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