Martin Bagge / brother

Results 92 comments of Martin Bagge / brother

The test for -z var is special and might not be the best example for demonstrating that the enable=all is broken. If you change to a echo of the variable...

Looking at the [2023 FAQ](https://www.oilshell.org/blog/2023/03/faq.html). > It runs POSIX shell and [bash](https://www.oilshell.org/cross-ref.html?tag=bash#bash) scripts, almost always without modification. Sounds like OSH could be a alias for any POSIX shell then? Might...

Could be that OP is executing shellcheck with all checks active, even the optional. ``` $ shellcheck --list-optional | grep -A4 check-unassigned-uppercase name: check-unassigned-uppercase desc: Warn when uppercase variables are...

With the new knowledge and lights can you please refine the description of the issue? As far as I can tell shellcheck is behaving exactly as intended. Having all optional...

I would like a optional check for this indeed. (on team "don't use the function keyword" =))

Maybe activate the [optional check](https://github.com/koalaman/shellcheck/wiki/Optional) for unassigned uppercase vars? ``` name: check-unassigned-uppercase desc: Warn when uppercase variables are unassigned example: echo $VAR fix: VAR=hello; echo $VAR ``` ```shell brother ~$...

Seems legit. I would probably encapsulate the pattern in quotation marks and thus not trigger the warning.

> I'd expect that in this case quotes shouldn't change the behaviour though. Indeed. And that's why I think the report is correct and the problem is probably with the...

> Alternatively this could be implemented in the shellcheck control notation along side `# shellcheck disable...`. isn't this already the case? Via a directive set the type of shell. `#...