Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SC2282 - variables starting with numbers aren't flagged as errors if done in arithmetic context #2958

Open
4 tasks done
RVC2020 opened this issue Apr 1, 2024 · 0 comments

Comments

@RVC2020
Copy link

RVC2020 commented Apr 1, 2024

For bugs

  • Rule Id: SC2282
  • My shellcheck version (shellcheck --version or "online"): 0.10.0
  • The rule's wiki page does not already cover this
  • I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit

For new checks and feature suggestions

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


#!/bin/bash
((1num=1+2))
2num=$((10+1))

Here's what shellcheck currently says:

In test.sh line 3:
2num=$((10+1))
^------------^ SC2282 (error): Variable names can't start with numbers, so this is interpreted as a command.

Here's what I wanted or expected to see:

1num also be flagged as an error under SC2282,

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

No branches or pull requests

1 participant