From b563cfc2ed32ba7e707b80724888461b70a3eadb Mon Sep 17 00:00:00 2001 From: helly25 <6420169+helly25@users.noreply.github.com> Date: Mon, 7 Sep 2026 19:03:55 +0100 Subject: [PATCH] Fix documentation names, omissions, and typos --- CONTRIBUTING.md | 2 +- README.md | 2 +- RULES.md | 4 ++-- bashtest/README.md | 6 ++++-- bashtest/bashtest.bzl | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c2c761..bd943ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ All contributions are generally welcome as long as they fit in with the concepts # Code Rules -All code must adhere to the [RULES.dm](RULES.md) and mostly follows the [Google style](https://google.github.io/styleguide/). Where it diverges, clang-tidy rules are in effect as much as possible. +All code must adhere to the [RULES.md](RULES.md) and mostly follows the [Google style](https://google.github.io/styleguide/). Where it diverges, clang-tidy rules are in effect as much as possible. # Run pre-commit diff --git a/README.md b/README.md index 845b5aa..9319cf8 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ locally or with `--sandbox_debug`. * scratch helper `test_tmpdir [name]`: Creates and prints a unique directory below `${BASHTEST_TMPDIR}`. * expectation `expect_eq` "\${LHS}" "\${RHS}": Asserts that two strings are the same. * expectation `expect_ne` "\${LHS}" "\${RHS}": Asserts that two strings are different. -* expectation `expect_files_eq` "\${LHS}" "\${RHS}": Asserts that two file are the same (supports golden updates). +* expectation `expect_files_eq` "\${LHS}" "\${RHS}": Asserts that two files are the same (supports golden updates). * expectation `expect_contains` "\${EXPECTED}" "\${ARRAY[@]}": Assert that one string is present in an array. * expectation `expect_not_contains` "\${EXPECTED}" "\${ARRAY[@]}": Assert that one string is not present in an array. * expectation `expect_output_contains` "\${SUBSTRING}" "\${TEXT}": Assert that a text contains a literal substring. diff --git a/RULES.md b/RULES.md index 05a7ea9..a43d319 100644 --- a/RULES.md +++ b/RULES.md @@ -1,6 +1,6 @@ Some rules for the code layout and its development. -* Everything is under Apache 2 license, see fle `LICENSE`. +* Everything is under Apache 2 license, see file `LICENSE`. * All sources must be unix-text files: https://en.wikipedia.org/wiki/Text_file * Lines end in {LF}. * The files are either empty or end in {LF}. @@ -8,6 +8,6 @@ Some rules for the code layout and its development. * No namespace may be named 'internal'. * All public / exported code must: * be tested, - * have a documentaion. + * have documentation. * API changes that are not backwards compatible should not occur in minor version changes. * Undocumented and private/internal APIs may be changed in any way at any time. diff --git a/bashtest/README.md b/bashtest/README.md index 492ac80..673183c 100644 --- a/bashtest/README.md +++ b/bashtest/README.md @@ -4,12 +4,13 @@ Bashtest provides `sh_test` wrapper that simplifies the creation of shell tests. * bashtest:bashtest, bashtest/bashtest.sh - * sh_library `bashtest.sh` which provides a test runner for complex shell tests involving golden files that provides built-in golden update functionality (see `bazel run //bashtest:bashtest_help`). + * sh_library `bashtest_sh` which provides a test runner for complex shell tests involving golden files that provides built-in golden update functionality (see `bazel run //bashtest:bashtest_help`). * status helper `test_has_error`: Returns whether a test function has had an expectation error. This is reset for every test function. * status helper `test_has_failed_tests`: Returns whether a test program had previous failing test functions. + * scratch helper `test_tmpdir [name]`: Creates and prints a unique directory below `${BASHTEST_TMPDIR}`. * expectation `expect_eq` "\${LHS}" "\${RHS}": Asserts that two strings are the same. * expectation `expect_ne` "\${LHS}" "\${RHS}": Asserts that two strings are different. - * expectation `expect_files_eq` "\${LHS}" "\${RHS}": Asserts that two file are the same (supports golden updates). + * expectation `expect_files_eq` "\${LHS}" "\${RHS}": Asserts that two files are the same (supports golden updates). * expectation `expect_contains` "\${EXPECTED}" "\${ARRAY[@]}": Assert that one string is present in an array. * expectation `expect_not_contains` "\${EXPECTED}" "\${ARRAY[@]}": Assert that one string is not present in an array. * expectation `expect_output_contains` "\${SUBSTRING}" "\${TEXT}": Assert that a text contains a literal substring. @@ -18,5 +19,6 @@ Bashtest provides `sh_test` wrapper that simplifies the creation of shell tests. * expectation `expect_not_matches` "\${REGEX}" "\${TEXT}": Assert that a text does not match an extended regular expression. * expectation `expect_pcre_matches` "\${REGEX}" "\${TEXT}": Assert that a text matches a Perl Compatible Regular Expression (requires an external PCRE tool). * expectation `expect_pcre_not_matches` "\${REGEX}" "\${TEXT}": Assert that a text does not match a Perl Compatible Regular Expression. + * control `skip_test` "\${REASON}": Marks the current test as skipped and reports the reason. Use `skip_test "reason" && return` to end the test body. * special test function `test::test_init`: If present, then this function runs first! Tests will only be executed if it succeeds. * special test function `test::test_done`: If present, then this function runs last! diff --git a/bashtest/bashtest.bzl b/bashtest/bashtest.bzl index 4e8b8cc..a3c384b 100644 --- a/bashtest/bashtest.bzl +++ b/bashtest/bashtest.bzl @@ -20,8 +20,8 @@ load("@rules_shell//shell:sh_test.bzl", "sh_test") # Resolve the bashtest runtime relative to *this* module's repository. A `Label` # constructed in a `.bzl` file is resolved against the repo that defines the # file, so the macro works no matter what apparent repo name a consumer assigns -# it (and under both bzlmod and the legacy WORKSPACE setup). This is what lets -# the module to work without an apparent repository-name alias. +# it through bzlmod. This lets the module work without an apparent +# repository-name alias. _BASHTEST_SH = Label("//bashtest:bashtest_sh") def bashtest( @@ -31,7 +31,7 @@ def bashtest( **kwargs): """Bashtest wrapper. - Specialized `sh_shell` rule to simplify `bashtest` usage. The rule provides + Specialized `sh_test` rule to simplify `bashtest` usage. The rule provides the `mboworks_bashtest` environment variable that should be used in test scripts to source the `bashtest.sh` script as follows: