From 45dfb6269825eaa1ddcac417a082865bee327bb1 Mon Sep 17 00:00:00 2001 From: yash-nisar Date: Wed, 14 Jun 2017 22:48:53 +0530 Subject: [PATCH] RubocopBear: Optional generation of `config_file` 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 https://github.com/coala/coala-bears/issues/1839 --- bears/ruby/RuboCopBear.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bears/ruby/RuboCopBear.py b/bears/ruby/RuboCopBear.py index 4fdb0f0a09..667534b7bd 100644 --- a/bears/ruby/RuboCopBear.py +++ b/bears/ruby/RuboCopBear.py @@ -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. @@ -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': {