{"action":"opened","issue":{"url":"https://api.github.com/repos/koalaman/shellcheck/issues/1229","repository_url":"https://api.github.com/repos/koalaman/shellcheck","labels_url":"https://api.github.com/repos/koalaman/shellcheck/issues/1229/labels{/name}","comments_url":"https://api.github.com/repos/koalaman/shellcheck/issues/1229/comments","events_url":"https://api.github.com/repos/koalaman/shellcheck/issues/1229/events","html_url":"https://github.com/koalaman/shellcheck/issues/1229","id":325371535,"number":1229,"title":"Add a special case warning for parens in `for f in (a b)`","user":{"login":"koalaman","id":2818758,"avatar_url":"https://avatars0.githubusercontent.com/u/2818758?v=4","gravatar_id":"","url":"https://api.github.com/users/koalaman","html_url":"https://github.com/koalaman","followers_url":"https://api.github.com/users/koalaman/followers","following_url":"https://api.github.com/users/koalaman/following{/other_user}","gists_url":"https://api.github.com/users/koalaman/gists{/gist_id}","starred_url":"https://api.github.com/users/koalaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koalaman/subscriptions","organizations_url":"https://api.github.com/users/koalaman/orgs","repos_url":"https://api.github.com/users/koalaman/repos","events_url":"https://api.github.com/users/koalaman/events{/privacy}","received_events_url":"https://api.github.com/users/koalaman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-22T16:27:50Z","updated_at":"2018-05-22T16:27:50Z","closed_at":null,"author_association":"OWNER","body":"#### For bugs\r\n- Rule Id (if any, e.g. SC1000): \r\n- My shellcheck version (`shellcheck --version` or \"online\"): \r\n- [x] I tried on shellcheck.net and verified that this is still a problem on the latest commit\r\n- [ ] It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue\r\n\r\n#### For new checks and feature suggestions\r\n- [ ] shellcheck.net (i.e. the latest commit) currently gives no useful warnings about this\r\n- [x] I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related\r\n\r\n\r\n#### Here's a snippet or screenshot that shows the problem:\r\n\r\nIt's somewhat common to try to put parens around for arguments:\r\n\r\n```sh\r\nfor f in (a b c)\r\ndo echo \"$f\"; done\r\n```\r\n\r\nExamples:\r\n\r\n```\r\nfor dir in ( cat foo.txt )\r\nfor file in ( file* )\r\nfor num in ( 0..100 )\r\n```\r\n\r\n#### Here's what shellcheck currently says:\r\n\r\nCurrently, this is caught with a generic \"shell word starts with (\" check:\r\n\r\n```\r\nfor f in (a b c)\r\n^-- SC1073: Couldn't parse this for loop. Fix to allow more checks.\r\n         ^-- SC1036: '(' is invalid here. Did you forget to escape it?\r\n```\r\n\r\nBut obviously it's not supposed to be escaped.\r\n\r\n#### Here's what I wanted or expected to see:\r\n\r\nSince the intent is known, a specific warning could be more helpful:\r\n\r\n```\r\nfor f in (a b c)\r\n^-- SC1073: Couldn't parse this for loop. Fix to allow more checks.\r\n         ^-- SC1XXX: Remove invalid (..) around `for` arguments, or use `while read` to process command output.\r\n```"}}
{"actor":{"display_login":"koalaman"}}