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

Fix a few ShellCheck SC2086 & SC2155 in Wrapper's Linux script #1892

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

vorburger
Copy link
Contributor

@vorburger vorburger changed the title fix: Fix a few ShellCheck SC2086 & SC2155 in Wrapper's Linux script Fix a few ShellCheck SC2086 & SC2155 in Wrapper's Linux script Dec 29, 2024
@vorburger
Copy link
Contributor Author

Oups, hang on, at least one of the change proposed (automagically) here actually appears to break the wrapper... do not merge!

@vorburger vorburger marked this pull request as draft December 29, 2024 16:10
@vorburger
Copy link
Contributor Author

vorburger commented Dec 29, 2024

at least one of the change [originally] proposed (automagically) here actually appears to break the wrapper

Found it - that ${JBANG_JAVA_OPTIONS} should not be quoted, so I've undone that, and it works again.

It would be good to have a # shellcheck disable=SC2086 there, to avoid future confusion - so I've added that.

Please do carefully review to make sure that this doesn't break anything else (but I think as-is now it's fine).

PS: I'm not sure (didn't check) if CI caught this - is there integration test coverage for the wrapper?

@vorburger vorburger marked this pull request as ready for review December 29, 2024 16:21
@@ -219,8 +219,10 @@ fi

## run it using command substitution to have just the user process once jbang is done
export JBANG_RUNTIME_SHELL=bash
export JBANG_STDIN_NOTTY=$([ -t 0 ] && echo "false" || echo "true")
JBANG_STDIN_NOTTY=$([ -t 0 ] && echo "false" || echo "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this line get split (and the other not)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See https://www.shellcheck.net/wiki/SC2155 ... so it's because this line uses $( ... ) and the other two do not.

@maxandersen
Copy link
Collaborator

Last time I tried shell check it was overly cautious but happy to see if we can improve :) this does change quotes so even though we do have some decent level of intégration tests in itest i'm not confident it tests for these.

It would be great to actually have some test showing the issue shell check is worried about over just fixing it do reduce lint warnings.

@vorburger
Copy link
Contributor Author

Last time I tried shell check it was overly cautious but happy to see if we can improve :) this does change quotes so even though we do have some decent level of intégration tests in itest i'm not confident it tests for these.

FWIW I did actually test these changes myself... ;-) and it seems to still work.

It would be great to actually have some test showing the issue shell check is worried about over just fixing it do reduce lint warnings.

That would be cool (but I wouldn't want to be the one contributing it). To me, this is more like fixing a warning from a compiler or build tool - you typically perhaps wouldn't write a test?

@maxandersen maxandersen merged commit 27935f7 into jbangdev:main Jan 16, 2025
10 checks passed
@maxandersen
Copy link
Collaborator

YOLO :)

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