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

Feature request: recommend for arg; do syntax #2050

Open
2 tasks done
hseg opened this issue Sep 3, 2020 · 2 comments
Open
2 tasks done

Feature request: recommend for arg; do syntax #2050

hseg opened this issue Sep 3, 2020 · 2 comments

Comments

@hseg
Copy link

hseg commented Sep 3, 2020

For new checks and feature suggestions

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

#!/bin/sh
for i in "$@"; do ... done

Here's what shellcheck currently says:

Nothing

Here's what I wanted or expected to see:

This can be written more concisely and clearly as for i; do ... done

@matthewpersico
Copy link

That's more clear? A for loop with an implied target? Forgive me, because I LOVE Perl, but this is not Perl. I don't think shellcheck should be in the business of playing "bash golf". And in 30+ years of coding, I have never seen this. I verified it works, but I think it's just too cute to be a desired practice. But I am not the one doing the evaluations, so good luck to you.

@hseg
Copy link
Author

hseg commented Sep 6, 2020 via email

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

2 participants