Skip to content

Commit

Permalink
RubocopBear: Optional generation of config_file
Browse files Browse the repository at this point in the history
Generation of `config_file` is only done if `rubocop_config` is
absent as an argument. This is a performance gain since
`config_file` was generated irrespective of `rubocop_config`,
each time the bear was run.

Closes #1839
  • Loading branch information
yash-nisar committed Jun 15, 2017
1 parent c886488 commit 45dfb62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bears/ruby/RuboCopBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def generate_config(filename, file,
ignore_unused_block_args_if_empty: bool=True,
allow_unused_block_keyword_arguments: bool=False,
ignore_unused_method_args_if_empty: bool=True,
allow_unused_method_keyword_args: bool=False):
allow_unused_method_keyword_args: bool=False,
rubocop_config: str=''):
"""
Not all settings added.
Notable settings missing: Rails settings.
Expand Down Expand Up @@ -174,6 +175,9 @@ class members.
:param allow_unused_method_keyword_args:
Allows unused keyword arguments in a method.
"""
if rubocop_config:
return None

naming_convention = {'camel': 'camelCase', 'snake': 'snake_case'}
options = {
'Style/AccessModifierIndentation': {
Expand Down

0 comments on commit 45dfb62

Please sign in to comment.