{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/3631","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3631/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3631/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3631/events","html_url":"https://github.com/bbatsov/rubocop/issues/3631","id":183243445,"number":3631,"title":"Add a cop to prevent `-> (` lambda format","user":{"login":"astorije","id":113730,"avatar_url":"https://avatars.githubusercontent.com/u/113730?v=3","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bbatsov/rubocop/labels/feature%20request","name":"feature request","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-16T01:38:45Z","updated_at":"2016-10-17T08:57:21Z","closed_at":null,"body":"As discovered in https://github.com/rmosolgo/graphql-ruby/pull/313:\r\n\r\n- Both `-> (arg) { ... }` **and** `->(arg) { ... }` are supported in Ruby 2+ (notice the space between `->` and the parenthesis.\r\n- `-> (arg) { ... }` is **not** supported in Ruby 1.9.3 and the interpreter reports:\r\n\r\n```rb\r\nsyntax error, unexpected tLPAREN_ARG, expecting keyword_do_LAMBDA or tLAMBEG (SyntaxError)\r\n      -> (arg) {\r\n          ^\r\n```\r\n\r\nIt seems reasonable to me to enforce `->(arg) { ... }` in style guides. After all, all examples in Rubocop's doc or your [Ruby style guide](https://github.com/bbatsov/ruby-style-guide) use this format consistently.\r\n\r\nThis is very valuable when developing a library that supports both versions 1.9.3 and 2+.\r\n\r\nLooking forward to hearing your opinion on that."},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/254150915","html_url":"https://github.com/bbatsov/rubocop/issues/3631#issuecomment-254150915","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3631","id":254150915,"user":{"login":"savef","id":6241279,"avatar_url":"https://avatars.githubusercontent.com/u/6241279?v=3","gravatar_id":"","url":"https://api.github.com/users/savef","html_url":"https://github.com/savef","followers_url":"https://api.github.com/users/savef/followers","following_url":"https://api.github.com/users/savef/following{/other_user}","gists_url":"https://api.github.com/users/savef/gists{/gist_id}","starred_url":"https://api.github.com/users/savef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savef/subscriptions","organizations_url":"https://api.github.com/users/savef/orgs","repos_url":"https://api.github.com/users/savef/repos","events_url":"https://api.github.com/users/savef/events{/privacy}","received_events_url":"https://api.github.com/users/savef/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T08:57:21Z","updated_at":"2016-10-17T08:57:21Z","body":"I like the idea of a cop to keep this consistent, but I would like the style to be configurable as I prefer the style with the space."}}
{"actor":{"display_login":"savef"}}