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
Should *_test.sh
be a bats file?
#405
Comments
+1 Personally, I'm in favor of getting rid of all .sh extensions ... unless we're doing POSIX sh. The executables in /bin don't have extensions so I don't see why executable shell scripts should have 'em. If we do need them, there's .bash and .bats |
I don't have strong opinions about this. The Google shell style guide has this to say about it
We can consider the test scripts as libraries, so I can see them with a The script files are not by default executable: the tests explicitly pass the filename to But I'm personally not motivated enough to do the work. |
I can make a PR if we can all agree on how to change them. I have one concern though. How will the CLI behave if we change the extensions of the files? I believe they will just download new files without deleting the old files. Is this correct? |
@tqa236 I think you are right about how the CLI will behave. There is a PR up right now that has to do with file names, but that work was automated, and a fix could be automated for it that wouldn't make it horrible to fix. You are right to think that older solutions will leave a weird directory when they are updated. If we agree to use If you want to make a PR for this it would be appreciated. Navigating all of the scripts that make assumptions about these extensions could take a little bit of coordinated effort, so ti might take a few days to get organized enough for the PR to be merged, but I am willing to spend some time making sure everything will work out 😄 |
If the exercise files are executable, and not considered library files, then I agree with removing the extension. The "magic comment" indicates the file type, and the file should be delivered with execute bit set. This is where we are going as far as providing "skeleton" files for the exercises, now, right? |
Yes, @kotp you are right. I don't think they are all executable currently, but we can change that. |
Do we want to encourage them as executable scripts, or more as libraries? |
@kotp still a great question. It seems like we had reached consensus that we should create a library style for the tests. None of the work has happened for that. I also remember something coming out of the Really, I think we need to see the way forward for Is your head in the same place mine is about this? |
I think it is. Bash is such a different beast because of how it is used than other, even scripting, languages. |
(From Slack discussion): I can do it, if everybody agrees: change shebang from I am less clear on where are server-side tests (they will need to accept the 2 extensions). Should solutions extension also be changed ? If yes, to About |
See exercism/bash-test-runner#27 and #541. |
Because, as far as I understand, it's a bats file...
bats files doesn't work very well with the tools for sh file, like
shellcheck
orkcov
, at least to me.Should we change the extension to
.bats
to show that they are bats files?The text was updated successfully, but these errors were encountered: