From 77f2ab245d52a7726b54483f315178cbb2568e2d Mon Sep 17 00:00:00 2001 From: motorailgun <28751910+motorailgun@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:37:38 +0000 Subject: [PATCH] fix(docs): align code block styles for shell snippets --- .../contrib/src/implementation/debugging.md | 2 +- src/doc/contrib/src/tests/profiling.md | 6 ++--- src/doc/contrib/src/tests/writing.md | 24 +++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/doc/contrib/src/implementation/debugging.md b/src/doc/contrib/src/implementation/debugging.md index c3a8e0423a1..e18abcda75f 100644 --- a/src/doc/contrib/src/implementation/debugging.md +++ b/src/doc/contrib/src/implementation/debugging.md @@ -8,7 +8,7 @@ It also supports filtering for specific modules with comma-separated [directives Feel free to use [shorthand macros] to help with diagnosing problems. We're looking forward to making Cargo logging mechanism more structural! -```sh +```bash # Outputs all logs with levels debug and higher CARGO_LOG=debug cargo generate-lockfile diff --git a/src/doc/contrib/src/tests/profiling.md b/src/doc/contrib/src/tests/profiling.md index f8410291b13..738bbd97de1 100644 --- a/src/doc/contrib/src/tests/profiling.md +++ b/src/doc/contrib/src/tests/profiling.md @@ -13,9 +13,9 @@ At process exit, your trace will be in a file like `trace-1668480819035032.json` Open that file with [ui.perfetto.dev](https://ui.perfetto.dev) (or chrome://tracing) to browse your trace. Example: -```console -$ # Output first three levels of profiling info -$ CARGO_LOG_PROFILE=true cargo generate-lockfile +```bash +# Output first three levels of profiling info +CARGO_LOG_PROFILE=true cargo generate-lockfile ``` **Note:** This is intended for the development of cargo and there are no compatibility guarantees on this functionality. diff --git a/src/doc/contrib/src/tests/writing.md b/src/doc/contrib/src/tests/writing.md index be92184af84..7037556d9df 100644 --- a/src/doc/contrib/src/tests/writing.md +++ b/src/doc/contrib/src/tests/writing.md @@ -221,8 +221,8 @@ Then populate The project, stdout, and stderr snapshots can be updated by running with the `SNAPSHOTS=overwrite` environment variable, like: -```console -$ SNAPSHOTS=overwrite cargo test +```bash +SNAPSHOTS=overwrite cargo test ``` Be sure to check the snapshots to make sure they make sense. @@ -265,18 +265,22 @@ expect, or you just generally want to experiment within the sandbox environment. The general process is: 1. Build the sandbox for the test you want to investigate. For example: - - `cargo test --test testsuite -- features2::inactivate_targets`. + ```bash + cargo test --test testsuite -- features2::inactivate_targets + ``` 2. In another terminal, head into the sandbox directory to inspect the files and run `cargo` directly. 1. The sandbox directories start with `t0` for the first test. - - `cd target/tmp/cit/t0` + ```bash + cd target/tmp/cit/t0 + ``` 2. Set up the environment so that the sandbox configuration takes effect: - - `export CARGO_HOME=$(pwd)/home/.cargo` + ```bash + export CARGO_HOME=$(pwd)/home/.cargo + ``` 3. Most tests create a `foo` project, so head into that: - - `cd foo` + ```bash + cd foo + ``` 3. Run whatever cargo command you want. See [Running Cargo] for more details on running the correct `cargo` process. Some examples: