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

Add auto-correct to rescue modifier #2126

Merged
merged 2 commits into from Aug 10, 2015

Conversation

rrosenblum
Copy link
Contributor

No description provided.

@@ -10,6 +10,14 @@ def configured_indentation_width
config.for_cop('IndentationWidth')['Width']
end

def indentation(node)
offset(node) + (' ' * configured_indentation_width)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing where allocating this a lot. He should probably make it a frozen constant.

@rrosenblum
Copy link
Contributor Author

I'm guessing where allocating this ' ' a lot. He should probably make it a frozen constant.

I have extracted the ' ' to a constant.

I am working on another commit that will extract commonly used variables to constants. I have been using memory_profiler to identify areas that can be cleaned up. So far, I have reduced memory allocation by RuboCop by about 8%.

bbatsov added a commit that referenced this pull request Aug 10, 2015
@bbatsov bbatsov merged commit 490c6af into rubocop:master Aug 10, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 10, 2015

I am working on another commit that will extract commonly used variables to constants. I have been using memory_profiler to identify areas that can be cleaned up. So far, I have reduced memory allocation by RuboCop by about 8%.

Excellent! We should probably spend some time in the future on performance optimizations as well. People with huge projects often complain that running RuboCop takes quite a while.

@rrosenblum
Copy link
Contributor Author

I am all for making RuboCop more performant. #2047 address auto-correct, but it does not address over all performance.

@rrosenblum rrosenblum deleted the autocorrect_rescue_modifier branch August 10, 2015 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants