From 3a13e052a6c7fec78ed979e9b46b692459a78008 Mon Sep 17 00:00:00 2001 From: rami3l Date: Wed, 31 Jul 2024 11:35:03 +0800 Subject: [PATCH 1/2] docs(dev-guide): update description of `rustup::process` --- doc/dev-guide/src/coding-standards.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/dev-guide/src/coding-standards.md b/doc/dev-guide/src/coding-standards.md index 0c03207aa6..efba929bf2 100644 --- a/doc/dev-guide/src/coding-standards.md +++ b/doc/dev-guide/src/coding-standards.md @@ -23,9 +23,12 @@ though that is helpful. ## No direct use of process state outside rustup::process The `rustup::process` module abstracts the global state that is -`std::env::args`, `std::env::vars`, `std::io::std*`, `std::process::id`, -`std::env::current_dir` and `std::process::exit` permitting threaded tests of -the CLI logic; use `process()` rather than those APIs directly. +`std::env::args`, `std::env::vars`, `std::io::std*` and `std::env::current_dir` +permitting threaded tests of the CLI logic; use the relevant methods of the +`rustup::process::Process` type rather than those APIs directly. +Usually, a `process: &Process` variable will be available to you in the current context. +For example, it could be in the form of a parameter of the current function, +or a field of a `Cfg` instance, etc. ## Clippy lints From 8900f05bf7a10584c12a54fe3dd76b70668b00a4 Mon Sep 17 00:00:00 2001 From: rami3l Date: Wed, 31 Jul 2024 11:35:29 +0800 Subject: [PATCH 2/2] docs(dev-guide): remove descriptions of `rustup_macros` --- doc/dev-guide/src/coding-standards.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/dev-guide/src/coding-standards.md b/doc/dev-guide/src/coding-standards.md index efba929bf2..079fd7074d 100644 --- a/doc/dev-guide/src/coding-standards.md +++ b/doc/dev-guide/src/coding-standards.md @@ -1,4 +1,3 @@ - # Coding standards Generally we just follow good sensible Rust practices, clippy and so forth. @@ -60,8 +59,3 @@ Clippy is also run in GitHub Actions, in the `General Checks / Checks` build task, but not currently run per-platform, which means there is no way to find out the status of clippy per platform without running it on that platform as a developer. - -### import rustup-macros::{integration,unit}_test into test modules - -These test helpers add pre-and-post logic to tests to enable the use of tracing -inside tests, which can be helpful for tracking down behaviours in larger tests.