shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

Unicode dash not being detected (SC1100)

Open na4ma4 opened this issue 4 months ago • 0 comments

For bugs with existing features

  • Rule Id (if any, e.g. SC1000): SC1100
  • My shellcheck version (shellcheck --version or "online"): 0.11.0 and online
  • [x] The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
  • [x] I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit

Here's a snippet or screenshot that shows the problem:

#!/bin/bash

[[ $(curl ‑‑help || true) != "" ]] && echo "blah"

curl ‑‑help

Here's what shellcheck currently says:

$ shellcheck -x --extended-analysis=true -s bash -a --enable=all -P SCRIPTDIR -S style scripts/test.sh

Here's what I wanted or expected to see:

Something declaring the use of the incorrect hyphen ( (\u2011 NON-BREAKING HYPHEN ) instead of -(\u002d HYPHEN-MINUS) )

Extra details

I can see that in the code it can look for these dashes, it kinda looks like that check only works for inside tests (the wiki page only shows where it is used in [[ 3 –gt 2 ]]), so maybe not detecting it is intended ?

I updated the example, using echo was pretty silly, but the check still works the same.

I did a small patch to src/Parser.hs, but my haskell is terrible, but it did work when I tested it on my example.

0001-Modified-weirdDash-detection-to-work-for-arguments-a.patch

na4ma4 avatar Aug 28 '25 03:08 na4ma4