diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-12-15 02:23:05 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-12-15 02:28:55 +0100 |
commit | 74e8b38dbe809022d096b11b87ba33a68ba0d374 (patch) | |
tree | 7b20a41924ef4325a5f6a57c7ea653b069be409f /pkgs/test | |
parent | 79618ff8cbfb69b6eb70dbc591b42cee2fed974e (diff) |
tests.nixpkgs-check-by-name: Move interface description into code
This would be duplicated otherwise
Diffstat (limited to 'pkgs/test')
-rw-r--r-- | pkgs/test/nixpkgs-check-by-name/README.md | 30 | ||||
-rw-r--r-- | pkgs/test/nixpkgs-check-by-name/src/main.rs | 14 |
2 files changed, 21 insertions, 23 deletions
diff --git a/pkgs/test/nixpkgs-check-by-name/README.md b/pkgs/test/nixpkgs-check-by-name/README.md index 7e8d39104e48b..640e744546a72 100644 --- a/pkgs/test/nixpkgs-check-by-name/README.md +++ b/pkgs/test/nixpkgs-check-by-name/README.md @@ -4,28 +4,14 @@ This directory implements a program to check the [validity](#validity-checks) of It is being used by [this GitHub Actions workflow](../../../.github/workflows/check-by-name.yml). This is part of the implementation of [RFC 140](https://github.com/NixOS/rfcs/pull/140). -## API - -This API may be changed over time if the CI workflow making use of it is adjusted to deal with the change appropriately. - -- Command line: `nixpkgs-check-by-name [--base <BASE_NIXPKGS>] <NIXPKGS>` -- Arguments: - - `<NIXPKGS>`: - The path to the Nixpkgs to check. - For PRs, this should be set to a checkout of the PR branch. - - `<BASE_NIXPKGS>`: - The path to the Nixpkgs to use as the [ratchet check](#ratchet-checks) base. - For PRs, this should be set to a checkout of the PRs base branch. - - If not specified, no ratchet checks will be performed. - However, this flag will become required once CI uses it. -- Exit code: - - `0`: If the [validation](#validity-checks) is successful - - `1`: If the [validation](#validity-checks) is not successful - - `2`: If an unexpected I/O error occurs -- Standard error: - - Informative messages - - Detected problems if validation is not successful +## Interface + +The interface of the tool is shown with `--help`: +``` +cargo run -- --help +``` + +The interface may be changed over time only if the CI workflow making use of it is adjusted to deal with the change appropriately. ## Validity checks diff --git a/pkgs/test/nixpkgs-check-by-name/src/main.rs b/pkgs/test/nixpkgs-check-by-name/src/main.rs index 01f7d4b71982a..18c950d0a6eb0 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/main.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/main.rs @@ -17,8 +17,20 @@ use std::path::{Path, PathBuf}; use std::process::ExitCode; /// Program to check the validity of pkgs/by-name +/// +/// This CLI interface may be changed over time if the CI workflow making use of +/// it is adjusted to deal with the change appropriately. +/// +/// Exit code: +/// - `0`: If the validation is successful +/// - `1`: If the validation is not successful +/// - `2`: If an unexpected I/O error occurs +/// +/// Standard error: +/// - Informative messages +/// - Detected problems if validation is not successful #[derive(Parser, Debug)] -#[command(about)] +#[command(about, verbatim_doc_comment)] pub struct Args { /// Path to the main Nixpkgs to check. /// For PRs, this should be set to a checkout of the PR branch. |