fix: handle file paths containing spaces - #102
Merged
Merged
Conversation
somaz94
marked this pull request as ready for review
August 3, 2026 06:24
somaz94
added a commit
to somaz94/somaz94
that referenced
this pull request
Aug 3, 2026
shogo82148
approved these changes
Aug 7, 2026
Contributor
|
🚀 [bumpr] Bumped! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FILESwas a space-joined string passed unquoted to shellcheck, so any path containing a space got word-split into fragments that do not exist. shellcheck printedopenBinaryFile: does not existon stderr and the file was never actually linted. Because reviewdog is last in the pipeline, the exit code was unaffected, so this failed silently.This collects matches into an array via
-print0and passes"${files[@]}". The awk shebang pass now emits NUL-separated output to match. Nomapfile/readarray, so the macOS runner (bash 3.2) still works.Validation
Run locally with shellcheck 0.11.0, the version
action.ymlpins.Using this repo's own step 4 config (
path: .+./testdata,check_all_files_with_shebangs: true) against the new fixtures:Also checked:
shellcheck --external-sources --severity=style script.shis clean (same flags as theshellcheck-github-checkstep)No matching files found to check.and exits 0 underset -uon bash 3.2awk 'printf "%s%c", FILENAME, 0'verified to emit real NUL bytes on BSD awk for the macOS legTest fixtures
Added under
testdata/space dir/to cover both collection paths:spaced test.shhas a space in both the directory and the filename, and exercises the pattern findnon-sh-testhas a shebang and no.shextension, and exercises the awk shebang findBoth names fall under the existing
.gitattributesrules (*.shandnon-sh-test), so the Windows leg checks them out with LF and shebang matching still works.Not addressed here
Step 4 lists overlapping paths (
.and./testdata), sotestdatafiles are collected twice. That predates this change and is unaffected by it, so I left it alone.closes: #41