{"action":"created","issue":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6370","repository_url":"https://api.github.com/repos/rubocop-hq/rubocop","labels_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6370/labels{/name}","comments_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6370/comments","events_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6370/events","html_url":"https://github.com/rubocop-hq/rubocop/issues/6370","id":367863203,"node_id":"MDU6SXNzdWUzNjc4NjMyMDM=","number":6370,"title":"Style/ModuleFunction autocorrection breaks code","user":{"login":"radiospiel","id":29153,"node_id":"MDQ6VXNlcjI5MTUz","avatar_url":"https://avatars0.githubusercontent.com/u/29153?v=4","gravatar_id":"","url":"https://api.github.com/users/radiospiel","html_url":"https://github.com/radiospiel","followers_url":"https://api.github.com/users/radiospiel/followers","following_url":"https://api.github.com/users/radiospiel/following{/other_user}","gists_url":"https://api.github.com/users/radiospiel/gists{/gist_id}","starred_url":"https://api.github.com/users/radiospiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radiospiel/subscriptions","organizations_url":"https://api.github.com/users/radiospiel/orgs","repos_url":"https://api.github.com/users/radiospiel/repos","events_url":"https://api.github.com/users/radiospiel/events{/privacy}","received_events_url":"https://api.github.com/users/radiospiel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-08T16:20:58Z","updated_at":"2018-10-09T01:57:07Z","closed_at":null,"author_association":"NONE","body":"## Expected behavior\r\n\r\nThe Style/ModuleFunction autocorrection should either not happen or not break code.\r\n\r\n## Actual behavior\r\n\r\nThis\r\n\r\n    module X\r\n      extend self\r\n      \r\n      def foo; bar; end\r\n  \r\n      private\r\n\r\n      def bar; end\r\n    end\r\n\r\ngets autocorrected into \r\n\r\n    module X\r\n      module_function\r\n      \r\n      def foo; bar; end\r\n  \r\n      private\r\n\r\n      def bar; end\r\n    end\r\n\r\nwhich - in contrast to the previous definition - does not define `X.bar`\r\n\r\n## Steps to reproduce the problem\r\n\r\nRun rubocop 0.59.2 with this code.\r\n\r\n## RuboCop version\r\n\r\n0.59.2\r\n"},"comment":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/comments/428033998","html_url":"https://github.com/rubocop-hq/rubocop/issues/6370#issuecomment-428033998","issue_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6370","id":428033998,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODAzMzk5OA==","user":{"login":"Drenmi","id":5259935,"node_id":"MDQ6VXNlcjUyNTk5MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/5259935?v=4","gravatar_id":"","url":"https://api.github.com/users/Drenmi","html_url":"https://github.com/Drenmi","followers_url":"https://api.github.com/users/Drenmi/followers","following_url":"https://api.github.com/users/Drenmi/following{/other_user}","gists_url":"https://api.github.com/users/Drenmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Drenmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drenmi/subscriptions","organizations_url":"https://api.github.com/users/Drenmi/orgs","repos_url":"https://api.github.com/users/Drenmi/repos","events_url":"https://api.github.com/users/Drenmi/events{/privacy}","received_events_url":"https://api.github.com/users/Drenmi/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T01:57:07Z","updated_at":"2018-10-09T01:57:07Z","author_association":"COLLABORATOR","body":"> I know that rubocop is in the \"module_function good, extend self bad\" camp. I am not.\r\n\r\nRuboCop is generally not in any \"camp\". The hope is to make it as configurable as possible. 🙂 The Ruby Style Guide might have a preference though.\r\n\r\n> But of course an auto correction run should not break existing source code.\r\n\r\nI fully agree with you and Mike. Our recommendations shouldn't alter the behaviour of the code. Labelling as a bug. 🙂 "}}
{"actor":{"display_login":"Drenmi"}}