Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = .git,*.pdf,*.svg
ignore-words-list = dne
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Codespell
uses: codespell-project/actions-codespell@94259cd8be02ad2903ba34a22d9c13de21a74461 # v2.0
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ The format is based on [Keep a Changelog][kac] and this project adheres to

### Added

* hardened CI scripts by using hashs instead of versions for actions (#754)
* hardened CI scripts by using hashes instead of versions for actions (#754)
* add security.md (#762)
* add codespell CI checks (#720)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ To run a single test file:
bin/bats test/file.bats
```

When running from a teminal, Bats uses the *pretty* formatter by default.
When running from a terminal, Bats uses the *pretty* formatter by default.
However, to debug Bats you might need to see the raw test output.
The **cat** formatter is intended as an internal debugging tool because
it does not process test outputs.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/docker-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For test suites that are intended to run in isolation from their project code, y
$ docker run -it -v "$PWD:/code" bats/bats:latest /code/test
```

This Docker image includes libaries like [bats-support](https://github.com/bats-core/bats-support) and [bats-assert](https://github.com/bats-core/bats-assert), which can be loaded in `setup` like this:
This Docker image includes libraries like [bats-support](https://github.com/bats-core/bats-support) and [bats-assert](https://github.com/bats-core/bats-assert), which can be loaded in `setup` like this:

```bash
setup() {
Expand Down
2 changes: 1 addition & 1 deletion docs/source/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal use.
If a test with the tag `bats:focus` is encountered in a test suite,
all other tests will be filtered out and only those tagged with this tag will be executed.

In focus mode, the exit code of successful runs will be overriden to 1 to prevent CI from silently running on a subset of tests due to an accidentally commited `bats:focus` tag.
In focus mode, the exit code of successful runs will be overridden to 1 to prevent CI from silently running on a subset of tests due to an accidentally committed `bats:focus` tag.
Should you require the true exit code, e.g. for a `git bisect` operation, you can disable this behavior by setting
`BATS_NO_FAIL_FOCUS_RUN=1` when running `bats`, but make sure not to commit this to CI!

Expand Down
2 changes: 1 addition & 1 deletion lib/bats-core/tracing.bash
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ bats_trim_filename() {
}

# normalize a windows path from e.g. C:/directory to /c/directory
# The path must point to an existing/accessable directory, not a file!
# The path must point to an existing/accessible directory, not a file!
bats_normalize_windows_dir_path() { # <output-var> <path>
local output_var="$1" path="$2"
if [[ "$output_var" != NORMALIZED_INPUT ]]; then
Expand Down
4 changes: 2 additions & 2 deletions libexec/bats-core/bats-exec-test
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bats_teardown_trap() {

# `bats_teardown_trap` is always called with one parameter (BATS_TEARDOWN_STARTED)
# The second parameter is optional and corresponds for to the killer pid
# that will be forwarded to the exit trap to kill it if necesary
# that will be forwarded to the exit trap to kill it if necessary
local killer_pid=${2:-}

# mark the start of this function to distinguish where skip is called
Expand Down Expand Up @@ -269,7 +269,7 @@ bats_start_timeout_countdown() { # <timeout>
# Start another process to kill the children of this process
(
sleep "$timeout" &
# sleep won't recieve signals, so we use wait below
# sleep won't receive signals, so we use wait below
# and kill sleep explicitly when signalled to do so
# shellcheck disable=SC2064
trap "kill $!; exit 0" ABRT
Expand Down
2 changes: 1 addition & 1 deletion man/bats.7
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Tag lists must be separated by commas and are allowed to contain whitespace\. Th
Every tag starting with \fBbats:\fR (case insensitive!) is reserved for Bats\' internal use:
.TP
\fBbats:focus\fR
If any test with the tag \fBbats:focus\fR is encountered in a test suite, only those tagged with this tag will be executed\. To prevent the CI from silently running on a subset of tests due to an accidentally commited \fBbats:focus\fR tag, the exit code of successful runs will be overriden to 1\.
If any test with the tag \fBbats:focus\fR is encountered in a test suite, only those tagged with this tag will be executed\. To prevent the CI from silently running on a subset of tests due to an accidentally committed \fBbats:focus\fR tag, the exit code of successful runs will be overridden to 1\.
.IP
Should you require the true exit code, e\.g\. for a \fBgit bisect\fR operation, you can disable this behavior by setting \fBBATS_NO_FAIL_FOCUS_RUN=1\fR when running \fBbats\fR, but make sure to not commit this to CI!
.SH "THE RUN HELPER"
Expand Down
4 changes: 2 additions & 2 deletions man/bats.7.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ internal use:
* `bats:focus`:
If any test with the tag `bats:focus` is encountered in a test suite, only those tagged with this tag will be executed.

In focus mode, the exit code of successful runs will be overriden to 1 to prevent CI from silently running on a subset
of tests due to an accidentally commited `bats:focus` tag.
In focus mode, the exit code of successful runs will be overridden to 1 to prevent CI from silently running on a subset
of tests due to an accidentally committed `bats:focus` tag.
Should you require the true exit code, e.g. for a `git bisect` operation, you can disable this behavior by setting
`BATS_NO_FAIL_FOCUS_RUN=1` when running `bats`, but make sure not to commit this to CI!

Expand Down
2 changes: 1 addition & 1 deletion test/cat-formatter.bats
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ not ok 1 a failing test
# (in test file test/fixtures/bats/failing.bats, line 4)
# \`eval "( exit ${STATUS:-1} )"' failed
begin 2 test_a_successful_test
ok 2 a succesful test
ok 2 a successful test
unknown line
EOF

Expand Down
2 changes: 1 addition & 1 deletion test/formatter.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ not ok 1 a failing test
# (in test file test/fixtures/bats/failing.bats, line 4)
# \`eval "( exit ${STATUS:-1} )"' failed
begin 2 test_a_successful_test
ok 2 a succesful test
ok 2 a successful test
unknown line
EOF
done
Expand Down
4 changes: 2 additions & 2 deletions test/parallel.bats
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ check_parallel_tests() { # <expected maximum parallelity>
export PARALLELITY=12

# file parallelization is needed for maximum parallelity!
# If we got over the skip (if no GNU parallel) in setup() we can reenable it safely!
# If we got over the skip (if no GNU parallel) in setup() we can re-enable it safely!
unset BATS_NO_PARALLELIZE_ACROSS_FILES
reentrant_run bash -c "bats --jobs $PARALLELITY \"${FIXTURE_ROOT}/suite/\" 2> >(grep -v '^parallel: Warning: ')"

Expand Down Expand Up @@ -104,7 +104,7 @@ check_parallel_tests() { # <expected maximum parallelity>
export PARALLELITY=2

# file parallelization is needed for this test!
# If we got over the skip (if no GNU parallel) in setup() we can reenable it safely!
# If we got over the skip (if no GNU parallel) in setup() we can re-enable it safely!
unset BATS_NO_PARALLELIZE_ACROSS_FILES
# run 4 files with parallelity of 2 -> serialize 2
reentrant_run bats --jobs $PARALLELITY "$FIXTURE_ROOT/setup_file"
Expand Down
4 changes: 2 additions & 2 deletions test/warnings.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ setup() {
[[ "$output" == "Invalid Bats warning number 'invalid-number'. It must be an integer between 1 and "* ]]
}

@test "BW01 is printed when \`run\`ing a (non-existant) command with exit code 127 without exit code check" {
@test "BW01 is printed when \`run\`ing a (non-existent) command with exit code 127 without exit code check" {
reentrant_run -0 bats "$FIXTURE_ROOT/BW01.bats"
[ "${lines[0]}" == "1..1" ]
[ "${lines[1]}" == "ok 1 Trigger BW01" ]
Expand All @@ -32,7 +32,7 @@ setup() {
[ "${lines[5]}" == " in test file $RELATIVE_FIXTURE_ROOT/BW01.bats, line 3)" ]
}

@test "BW01 is not printed when \`run\`ing a (non-existant) command with exit code 127 with exit code check" {
@test "BW01 is not printed when \`run\`ing a (non-existent) command with exit code 127 with exit code check" {
reentrant_run -0 bats "$FIXTURE_ROOT/BW01_check_exit_code_is_127.bats"
[ "${lines[0]}" == "1..1" ]
[ "${lines[1]}" == "ok 1 Don't trigger BW01 with checked exit code 127" ]
Expand Down