Skip to content

Tidy: disallow TODO in other in-tree projects#153166

Open
reddevilmidzy wants to merge 3 commits intorust-lang:mainfrom
reddevilmidzy:codegen-tidy
Open

Tidy: disallow TODO in other in-tree projects#153166
reddevilmidzy wants to merge 3 commits intorust-lang:mainfrom
reddevilmidzy:codegen-tidy

Conversation

@reddevilmidzy
Copy link
Member

@reddevilmidzy reddevilmidzy commented Feb 27, 2026

@rustbot rustbot added 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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 27, 2026
@reddevilmidzy reddevilmidzy marked this pull request as ready for review February 27, 2026 06:21
@rustbot
Copy link
Collaborator

rustbot commented Feb 27, 2026

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rustbot rustbot 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 Feb 27, 2026
@bjorn3
Copy link
Member

bjorn3 commented Feb 27, 2026

Tidy does not run inside the cg_clif and cg_gcc repos, which means whenever we do a sync, there is a fair chance that we did be forced to male changes when tidy complains.

@jieyouxu
Copy link
Member

jieyouxu commented Feb 27, 2026

Tidy does not run inside the cg_clif and cg_gcc repos, which means whenever we do a sync, there is a fair chance that we did be forced to male changes when tidy complains.

I would suggest not running full tidy against the cg_* subtrees yeah.

Also, doesn't rust-lang/compiler-team#963 only say TODO -> FIXME? Not other tidy checks? I do not think we should be enforcing other tidy rules for the cg_* subtrees.

@reddevilmidzy
Copy link
Member Author

Ah, I overinterpreted it — my mistake. Thanks for the clarification. I’ll update it accordingly.

@reddevilmidzy reddevilmidzy marked this pull request as draft February 27, 2026 10:58
@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 Feb 27, 2026
@rust-bors

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the codegen-tidy branch 2 times, most recently from 89a1cb9 to 2617d54 Compare March 7, 2026 12:39
@reddevilmidzy reddevilmidzy changed the title Allow tidy check in codegen Tidy: disallow TODO in other in-tree projects Mar 7, 2026
Copy link
Member Author

@reddevilmidzy reddevilmidzy left a comment

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to add cg_* checks to style.rs, which checks TODOs in tidy, but since it also checks other things besides TODOs, I separated it into codegen.rs.

}
}

// todo: this function now accepts `Session` instead of `ParseSess` and should be relocated
Copy link
Member Author

Choose a reason for hiding this comment

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

lowercase 👀

@reddevilmidzy reddevilmidzy marked this pull request as ready for review March 7, 2026 12:50
@rustbot rustbot 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 Mar 7, 2026
@rust-log-analyzer

This comment has been minimized.

.enumerate()
.map(|(index, field)| {
self.context.new_field(None, *field, format!("field{}_TODO", index))
self.context.new_field(None, *field, format!("field{}_FIXME", index))
Copy link
Contributor

Choose a reason for hiding this comment

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

is that fine?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I'll check this again. Thank you

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed TODO to FIXME and tested it and it worked.

rust-lang/rustc_codegen_gcc@d82d242

cc: @antoyo

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this should be OK.

let is_codegen_tidy_file = file.ends_with(codegen_file);
if is_codegen_tidy_file {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why this?

Copy link
Member Author

Choose a reason for hiding this comment

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

a035848#diff-2877cff958f18d248fbdb0e5f924a453e3911e7e8340139125911d3bdd8e5a62R49-R53

I'm using the "TODO" character here and top line, this is the part that was added to skip TODO check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking issue for MCP 963: Extend the x.py policy for TODO and FIXME to other in-tree projects

7 participants