Open
Description
For bugs
- Rule Id (if any, e.g. SC1000): SC2236 and SC2237
- My shellcheck version (
shellcheck --version
or 'online'): online - I tried on shellcheck.net and verified that this is still a problem on the latest commit
- It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue
For new checks and feature suggestions
- shellcheck.net (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
Here's a snippet or screenshot that shows the problem:
#!/bin/sh
test ! -n "$1"
! test -z "$1"
Here's what shellcheck currently says:
nothing
Here's what I wanted or expected to see:
Line 2 SC2236: Use -z instead of ! -n.
Line 3 SC2237: Use test -n .. instead of ! test -z ...
Metadata
Metadata
Assignees
Labels
No labels