Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify -c .rubocop.yml for bin/rubocop (performance) #6915

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

martinemde
Copy link
Member

Speeds up rubocop by 13% based on hyperfine, presumably because it doesn't need to look for the right config file.

What was the end-user or developer problem that led to this PR?

Another attempt at #6913 which addresses this as a performance improvement, in addition to a temporary big fix.

Hyperfine shows a 13% improvement over the identical command and environment without -c .rubocop.yml.

What is your fix for the problem, implemented in this PR?

Explicit .rubocop.yml config

Make sure the following tasks are checked

Speeds up rubocop by 13% based on hyperfine, presumably because it doesn't
need to look for the right config file.
@simi
Copy link
Member

simi commented Aug 24, 2023

@martinemde just out of my curiosity, does it save time if you have no config in parent directories (including home one)?

@martinemde
Copy link
Member Author

@simi yes. My ~/.rubocop.yml won't load, so I renamed it when doing this perf test. This is just comparing -c .rubocop.yml with no config files to find. Docs indicate that -c skips all the config loading behavior and just uses the specified file; probably where the performance gain comes from.

@martinemde martinemde merged commit d013399 into master Aug 24, 2023
83 checks passed
@martinemde martinemde deleted the martinemde/explicit-rubocop-config branch August 24, 2023 20:38
deivid-rodriguez pushed a commit that referenced this pull request Sep 21, 2023
…nfig

Specify -c .rubocop.yml for bin/rubocop (performance)

(cherry picked from commit d013399)
deivid-rodriguez pushed a commit that referenced this pull request Sep 21, 2023
…nfig

Specify -c .rubocop.yml for bin/rubocop (performance)

(cherry picked from commit d013399)
zzak added a commit to zzak/rails that referenced this pull request Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants