{"action":"created","issue":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6492","repository_url":"https://api.github.com/repos/rubocop-hq/rubocop","labels_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6492/labels{/name}","comments_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6492/comments","events_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6492/events","html_url":"https://github.com/rubocop-hq/rubocop/issues/6492","id":381473760,"node_id":"MDU6SXNzdWUzODE0NzM3NjA=","number":6492,"title":"rubocop -a is slow","user":{"login":"gurgeous","id":526195,"node_id":"MDQ6VXNlcjUyNjE5NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/526195?v=4","gravatar_id":"","url":"https://api.github.com/users/gurgeous","html_url":"https://github.com/gurgeous","followers_url":"https://api.github.com/users/gurgeous/followers","following_url":"https://api.github.com/users/gurgeous/following{/other_user}","gists_url":"https://api.github.com/users/gurgeous/gists{/gist_id}","starred_url":"https://api.github.com/users/gurgeous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurgeous/subscriptions","organizations_url":"https://api.github.com/users/gurgeous/orgs","repos_url":"https://api.github.com/users/gurgeous/repos","events_url":"https://api.github.com/users/gurgeous/events{/privacy}","received_events_url":"https://api.github.com/users/gurgeous/received_events","type":"User","site_admin":false},"labels":[{"id":3608334,"node_id":"MDU6TGFiZWwzNjA4MzM0","url":"https://api.github.com/repos/rubocop-hq/rubocop/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":1053990079,"node_id":"MDU6TGFiZWwxMDUzOTkwMDc5","url":"https://api.github.com/repos/rubocop-hq/rubocop/labels/high%20priority","name":"high priority","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-16T07:08:33Z","updated_at":"2018-11-18T12:05:53Z","closed_at":null,"author_association":"NONE","body":"See https://github.com/ruby-formatter/rufo/issues/2 and https://github.com/Microsoft/vscode/issues/41194. It is not really possible to use Rubocop autocorrect in vscode unless the user manually increases the `editor.formatOnSaveTimeout`. I have mine set to 3s, which seems to be sufficient for my app on my beefy machine. I bet if we sped up Rubocop autocorrect, many more people would adopt it for vscode Format on Save.\r\n\r\nHere's a simple benchmark:\r\n\r\n```\r\n$ wget https://raw.githubusercontent.com/rails/rails/master/actionpack/lib/action_controller/metal/strong_parameters.rb\r\n$ time rubocop -a strong_parameters.rb\r\nInspecting 1 file\r\n...\r\n1 file inspected, 118 offenses detected, 114 offenses corrected\r\n\r\nreal\t0m3.087s\r\nuser\t0m2.853s\r\nsys\t0m0.194s\r\n```\r\n\r\nI have 43 cops disabled in my .rubocop.yml, so the vanilla config might be slower. Thanks so much for all your hard work on Rubocop. I love it and use it daily with all my projects!"},"comment":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/comments/439687857","html_url":"https://github.com/rubocop-hq/rubocop/issues/6492#issuecomment-439687857","issue_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6492","id":439687857,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTY4Nzg1Nw==","user":{"login":"jonas054","id":336720,"node_id":"MDQ6VXNlcjMzNjcyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/336720?v=4","gravatar_id":"","url":"https://api.github.com/users/jonas054","html_url":"https://github.com/jonas054","followers_url":"https://api.github.com/users/jonas054/followers","following_url":"https://api.github.com/users/jonas054/following{/other_user}","gists_url":"https://api.github.com/users/jonas054/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas054/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas054/subscriptions","organizations_url":"https://api.github.com/users/jonas054/orgs","repos_url":"https://api.github.com/users/jonas054/repos","events_url":"https://api.github.com/users/jonas054/events{/privacy}","received_events_url":"https://api.github.com/users/jonas054/received_events","type":"User","site_admin":false},"created_at":"2018-11-18T12:05:53Z","updated_at":"2018-11-18T12:05:53Z","author_association":"COLLABORATOR","body":"> since that mirrors real world usage when plugged into an editor\r\n\r\nDo you by that mean that the most common case is that `rubocop -a` doesn't make any changes to the file? That's true. But it's more difficult to solve that case, I believe.\r\n\r\n> half the execution time is requiring files\r\n\r\nInteresting! How did you measure that?\r\n\r\n>  I wonder if we should only load cops that support autocorrect.\r\n\r\nThat's a big change. We've always let all configured cops report their offenses, running with or without `--auto-correct`. But we could make it configurable I guess. If it turns out to be a big performance boost.\r\n\r\nAlso... please take a look at my PR. :smile: "}}
{"actor":{"display_login":"jonas054"}}