Skip to content

Conversation

LikeLakers2
Copy link
Contributor

Objective

To be honest, typing tool commands suck due to just how long the commands are.

Also, what is a ci alias doing in a config file meant for fast builds...?

Solution

Create a config file for cargo aliases, under .cargo/config_aliases.toml, with many short aliases to useful commands.

Now instead of typing cargo run -p build-templated-pages -- update features, you can just run cargo update-feature-docs. :D

Testing

This change was tested by copying .cargo/config_aliases.toml to .cargo/config.toml, and running cargo --list to confirm that they showed up.

I also ran a few (but not all) of these aliases to ensure they work.

Comment on lines +26 to +41
# Check each file under `tools/ci/src/commands/` to see what each individual command does
ci-bench-check = "ci bench-check"
ci-clippy = "ci clippy"
ci-compile = "ci compile"
ci-compile-check = "ci compile-check"
ci-compile-fail = "ci compile-fail"
ci-doc = "ci doc"
ci-doc-check = "ci doc-check"
ci-doc-test = "ci doc-test"
ci-example-check = "ci example-check"
ci-format = "ci format"
ci-integration-test-check = "ci integration-test-check"
ci-integration-test-clean = "ci integration-test-clean"
ci-integration-test-run = "ci integration-test"
ci-lints = "ci lints"
ci-test = "ci test"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% on whether every single ci command should have its own alias.

On the one hand, this allows them to show up as valid commands in cargo --list. This alone makes me want to include them, such that people know they exist without needing to check the source code of the ci tool.

On the other, it doesn't save any time compared to, say, cargo ci doc.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for listing all

@Zeophlite Zeophlite added A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 19, 2025
@mockersf
Copy link
Member

I'm not sure they will be easy to keep in sync with the actual commands, but they don't change that much and people who cares about the alias will update them

@mockersf mockersf added this pull request to the merge queue Oct 19, 2025
Merged via the queue into bevyengine:main with commit ae8620e Oct 19, 2025
45 checks passed
@LikeLakers2 LikeLakers2 deleted the feat/cargo/tool-aliases branch October 19, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants