Bats ignores "dotfiles" when I tell it to look for .bats files in the current directory #863
Labels
Component: CLI
Command line flags, exit code handling, ...
Component: Docs
Priority: Medium
Wrong or misleading documentation, broken behavior with workaround
Size: Medium
Changes in the same file
Status: Confirmed
The reproducer worked as described
Type: Bug
Describe the bug
It seems that bats ignores
.bats
files that start with a leading.
when invoked to run on a directory.To Reproduce
Steps to reproduce the behavior:
.foobar.bats
bats .
Expected behavior
I'd expect it to pick up the files if I only give it the directly name.
Environment (please complete the following information):
bash --version
:master
Additional context
I have some shell function libraries named with a leading
.
. Usually I will locate the "script" under test using something like this:TOTEST="${BATS_TEST_FILENAME%.*}.sh"
, so simply switch the script extension for.bats
.This works quite nicely, but I noticed in a helper script that I use to both lint the scripts (with ShellCheck) and invoke the test harness,
bats
won't pick up on.bats
files starting with a leading.
.I know by convention these files are hidden and I understand if you say that's a design decision or can't be fixed because it would break existing behavior.
Just wanted to bring to your attention that this use case exists.
Thanks for
bats-core
!The text was updated successfully, but these errors were encountered: