luizm / action-sh-checker

A GitHub action that performs static analysis for shell scripts using shellcheck, shfmt and checkbashisms.
MIT License
132 stars 12 forks source link

a '\n' are executing instead readit causing SC2034 ERROR #15

Closed hellresistor closed 3 years ago

hellresistor commented 4 years ago

Correct Code (Passed in ShellCheck) MyBalR=$(echo "$MyBal" | awk '{printf("%d\n",$1 + 0.5)}')

Get this on action-sh-checker v0.1.5 (and4 too) (are doing the \n on checking instead read it)

MyBalR=$(echo "$MyBal" | awk '{printf("%d
",$1 + 0.5)}')
^----^ SC2034: MyBalR appears unused. Verify use (or export if used externally).
luizm commented 4 years ago

The error: SC2034 is not related with this break line "\n".

When shellcheck run over your script, it identifies the problem SC2034, and when sh-checker shows the output the character \n is converted to a new line.

hellresistor commented 4 years ago

Ok!

I tryed to say its this. See difference.

ShellCheck ShellCheck

Luiz checker louis-sh-checker

Exposing this. Is not a issue. more like a little bug

luizm commented 4 years ago

Exposing this. Is not a issue. more like a little bug

I can't work on it right now, but I will. Thank you for the report.

hellresistor commented 4 years ago

no problem! ;)