Skip to content

Conversation

@IgorTodorovskiIBM
Copy link
Member

@IgorTodorovskiIBM IgorTodorovskiIBM commented Oct 6, 2023

Also introduces the script tools/format_and_check_scripts.sh which depends on shfmt (go tool) and shellcheck (only available on non-z/OS since its written in haskell)

Related to #482

@IgorTodorovskiIBM
Copy link
Member Author

Exploring the options for shellcheck. I had passed -o all initially which triggered it to also change all information/warning cases. I'm using this currently:

shellcheck --shell sh -e SC2034,SC2048  --severity=error

Copy link
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

changes seem reasonable.
maybe this would be a good thing to put a test or two into metaport first to validate nothing breaks?

if $("${tool}" --help >/dev/null 2>&1); then
# Tool has implemented --help
if $( "${tool}" --version >/dev/null 2>&1 ) ; then
if $("${tool}" --version >/dev/null 2>&1); then
Copy link
Collaborator

Choose a reason for hiding this comment

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

i kinda like a space here - but if others don't, i'm ok to change... e.g. i prefer $( <cmd> ) rather than $(<cmd>)

Copy link
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

Does -z test for both unset and equal to ‘’ like the old code ?

@IgorTodorovskiIBM
Copy link
Member Author

Does -z test for both unset and equal to ‘’ like the old code ?

Yep:

[ITODORO@ZOSCAN2B ~/projects/meta_testme]$ unset BLA; test -z "$BLA"; echo $?
0
[ITODORO@ZOSCAN2B ~/projects/meta_testme]$ BLA=""; test -z "$BLA"; echo $?
0
[ITODORO@ZOSCAN2B ~/projects/meta_testme]$ BLA=''; test -z "$BLA"; echo $?
0
[ITODORO@ZOSCAN2B ~/projects/meta_testme]$

Copy link
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

Lgtm

@IgorTodorovskiIBM IgorTodorovskiIBM merged commit 8f8c882 into main Oct 8, 2023
@MikeFultonDev MikeFultonDev deleted the cleanmeup branch October 13, 2023 04:41
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