Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BATS: shellcheck #2033

Merged
merged 12 commits into from
Nov 7, 2024
Merged

BATS: shellcheck #2033

merged 12 commits into from
Nov 7, 2024

Conversation

gaelicWizard
Copy link
Contributor

@gaelicWizard gaelicWizard commented Jan 12, 2022

Description

As shellcheck supports BATS syntax, turn it on and use it! And then fix all the tests!

Motivation and Context

This is chapter 3 of my BATS adventure. This is for the tests themselves, not the main code/libraries/plugins. This ensures that our tests are working properly.

NOTE: this does NOT enable "strict mode" in BATS, it's still just shellcheck.

How Has This Been Tested?

Lots and lots and lots of test/run...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 3 times, most recently from be5db58 to f22362f Compare January 12, 2022 07:53
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 3 times, most recently from e4db16a to 5992577 Compare January 12, 2022 20:11
@gaelicWizard gaelicWizard marked this pull request as ready for review January 13, 2022 04:40
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 7 times, most recently from 3942841 to 09ee7d0 Compare January 25, 2022 21:56
@gaelicWizard gaelicWizard marked this pull request as draft January 25, 2022 21:57
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 6 times, most recently from 2dedae8 to 3a14000 Compare January 31, 2022 20:13
@gaelicWizard gaelicWizard changed the title BATS: shellcheck DRAFTL BATS: shellcheck Jan 31, 2022
@gaelicWizard gaelicWizard changed the title DRAFTL BATS: shellcheck DRAFT: BATS: shellcheck Jan 31, 2022
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 5 times, most recently from 74a2376 to 8849aa7 Compare February 2, 2022 21:42
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 4 times, most recently from 4b296db to 3f57775 Compare February 20, 2022 21:57
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 3 times, most recently from e3a1f51 to 461a4da Compare March 4, 2022 08:40
@gaelicWizard gaelicWizard marked this pull request as ready for review March 4, 2022 22:17
gaelicWizard and others added 9 commits March 4, 2022 14:17
BATS: add `*.bats` to `.gitattributes`
test: don't clobber `$PATH`

BATS depends on `$PATH` somehow and if not handled properly, modifying `$PATH` breaks BATS badly. But, it doesn't seem like we have any reason to modify `$PATH` in the first place...so don't.

test/svn: don't clobber `$PATH`
test/ruby: don't clobber `$PATH`
test/search: don't clobber `$PATH`
Make library loading overridable default for all tests, up through "seach".
@gaelicWizard gaelicWizard force-pushed the bats-precommit branch 2 times, most recently from 9043be3 to 6809635 Compare March 4, 2022 22:27
@gaelicWizard gaelicWizard changed the title DRAFT: BATS: shellcheck BATS: shellcheck Mar 4, 2022
@gaelicWizard
Copy link
Contributor Author

Ok! This one should be good to go. This just does shellcheck, not shfmt and not anything else. (I'll do shfmt in another PR.)

@gaelicWizard gaelicWizard mentioned this pull request Mar 4, 2022
6 tasks
Copy link
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is only shellcheck changes, in the tests, this is good to merge IMO
Great work @gaelicWizard !

@seefood seefood self-assigned this Nov 7, 2024
Copy link
Contributor

@seefood seefood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@seefood seefood merged commit 775044b into Bash-it:master Nov 7, 2024
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants