{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/2757","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2757/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2757/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2757/events","html_url":"https://github.com/bbatsov/rubocop/pull/2757","id":130484994,"number":2757,"title":"[Fix #2742] Fix TrailingComma cop for single element arrays","user":{"login":"Annih","id":559627,"avatar_url":"https://avatars.githubusercontent.com/u/559627?v=3","gravatar_id":"","url":"https://api.github.com/users/Annih","html_url":"https://github.com/Annih","followers_url":"https://api.github.com/users/Annih/followers","following_url":"https://api.github.com/users/Annih/following{/other_user}","gists_url":"https://api.github.com/users/Annih/gists{/gist_id}","starred_url":"https://api.github.com/users/Annih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Annih/subscriptions","organizations_url":"https://api.github.com/users/Annih/orgs","repos_url":"https://api.github.com/users/Annih/repos","events_url":"https://api.github.com/users/Annih/events{/privacy}","received_events_url":"https://api.github.com/users/Annih/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-01T21:11:07Z","updated_at":"2016-02-03T09:35:08Z","closed_at":"2016-02-03T09:35:04Z","pull_request":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2757","html_url":"https://github.com/bbatsov/rubocop/pull/2757","diff_url":"https://github.com/bbatsov/rubocop/pull/2757.diff","patch_url":"https://github.com/bbatsov/rubocop/pull/2757.patch"},"body":"Single line arrays with only one element were detected as multiline.\r\nMultiline detection fixed and optmized by returning if the whole node\r\nis single line.\r\n\r\nI first wanted to return at a different position in the code... but I got:\r\n> lib/rubocop/cop/mixin/trailing_comma.rb:67:7: C: Method has too many lines. [21/20]\r\n      def multiline?(node)\r\n      ^^^\r\n\r\nSo I ended up using the existing return statement.\r\n\r\nI hope it'll fit your criteria, let me know if you need any change.\r\n\r\nRegards.\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/179123498","html_url":"https://github.com/bbatsov/rubocop/pull/2757#issuecomment-179123498","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2757","id":179123498,"user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T09:35:08Z","updated_at":"2016-02-03T09:35:08Z","body":":+1: "}}