def run_rubocop(self, view):
    s = sublime.load_settings(SETTINGS_FILE)

    use_rvm = view.settings().get('check_for_rvm', s.get('check_for_rvm'))
    use_rbenv = view.settings().get('check_for_rbenv', s.get('check_for_rbenv'))
    cmd = view.settings().get('rubocop_command', s.get('rubocop_command'))
    rvm_path = view.settings().get('rvm_auto_ruby_path', s.get('rvm_auto_ruby_path'))
    rbenv_path = view.settings().get('rbenv_path', s.get('rbenv_path'))
    cfg_file = view.settings().get('rubocop_config_file', s.get('rubocop_config_file'))
    chdir = view.settings().get('rubocop_chdir', s.get('rubocop_chdir'))

    if cfg_file:
      cfg_file = FileTools.quote(cfg_file)

    runner = RubocopRunner(
      {
        'use_rbenv': use_rbenv,
        'use_rvm': use_rvm,
        'custom_rubocop_cmd': cmd,
        'rvm_auto_ruby_path': rvm_path,
        'rbenv_path': rbenv_path,
        'on_windows': sublime.platform() == 'windows',
        'rubocop_config_file': cfg_file,
        'chdir': chdir,
        'is_st2': sublime.version() < '3000'
      }
    )
    output = runner.run([view.file_name()], ['--format', 'emacs']).splitlines()

    return output
Ejemplo n.º 2
0
    def run_rubocop(self, view):
        s = sublime.load_settings(SETTINGS_FILE)

        use_rvm = view.settings().get('check_for_rvm', s.get('check_for_rvm'))
        use_rbenv = view.settings().get('check_for_rbenv',
                                        s.get('check_for_rbenv'))
        cmd = view.settings().get('rubocop_command', s.get('rubocop_command'))
        rvm_path = view.settings().get('rvm_auto_ruby_path',
                                       s.get('rvm_auto_ruby_path'))
        rbenv_path = view.settings().get('rbenv_path', s.get('rbenv_path'))
        cfg_file = view.settings().get('rubocop_config_file',
                                       s.get('rubocop_config_file'))
        chdir = view.settings().get('rubocop_chdir', s.get('rubocop_chdir'))

        if cfg_file:
            cfg_file = FileTools.quote(cfg_file)

        runner = RubocopRunner({
            'use_rbenv': use_rbenv,
            'use_rvm': use_rvm,
            'custom_rubocop_cmd': cmd,
            'rvm_auto_ruby_path': rvm_path,
            'rbenv_path': rbenv_path,
            'on_windows': sublime.platform() == 'windows',
            'rubocop_config_file': cfg_file,
            'chdir': chdir,
            'is_st2': sublime.version() < '3000'
        })
        output = runner.run([view.file_name()],
                            ['--format', 'emacs']).splitlines()

        return output
Ejemplo n.º 3
0
 def run_rubocop(self, path):
   s = sublime.load_settings(SETTINGS_FILE)
   use_rvm = s.get('check_for_rvm')
   use_rbenv = s.get('check_for_rbenv')
   cmd = s.get('rubocop_command')
   rvm_path = s.get('rvm_auto_ruby_path')
   rbenv_path = s.get('rbenv_path')
   runner = RubocopRunner(use_rbenv, use_rvm, cmd, rvm_path, rbenv_path)
   output = runner.run(path, '--format emacs').splitlines()
   return output
Ejemplo n.º 4
0
 def run_rubocop(self, path):
   s = sublime.load_settings(SETTINGS_FILE)
   use_rvm = s.get('check_for_rvm')
   use_rbenv = s.get('check_for_rbenv')
   cmd = s.get('rubocop_command')
   rvm_path = s.get('rvm_auto_ruby_path')
   rbenv_path = s.get('rbenv_path')
   cfg_file = s.get('rubocop_config_file')
   if cfg_file:
     cfg_file = FileTools.quote(cfg_file)
   runner = RubocopRunner(
     {
       'use_rbenv': use_rbenv,
       'use_rvm': use_rvm,
       'custom_rubocop_cmd': cmd,
       'rvm_auto_ruby_path': rvm_path,
       'rbenv_path': rbenv_path,
       'on_windows': sublime.platform() == 'windows',
       'rubocop_config_file': cfg_file
     }
   )
   output = runner.run(path, '--format emacs').splitlines()
   return output