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

beautify ruby does not respect my ~/.rubocop.yml #793

Closed
jemminger opened this issue Feb 9, 2016 · 12 comments · Fixed by #1776
Closed

beautify ruby does not respect my ~/.rubocop.yml #793

jemminger opened this issue Feb 9, 2016 · 12 comments · Fixed by #1776
Assignees
Milestone

Comments

@jemminger
Copy link

I have a .rubocop.yml file in my home directory. When I use atom-beautify on a ruby file, it does not use my settings.

E.g. I have it set to prefer double-quoted strings over single-quotes. When I run atom-beautify, it changes all my double-quotes back to single.

Here's the debug output:

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Tue Feb 09 2016 15:09:51 GMT-0500 (EST).


Table Of Contents


Platform: darwin

Versions

Atom Version: 1.4.3

Atom Beautify Version: 0.28.22

Original file to be beautified

Original File Path: /Users/jemminger/Rails/new_tsig/spec/controllers/campaigns_controller_spec.rb

Original File Grammar: Ruby on Rails

Original File Language: Ruby

Language namespace: ruby

Supported Beautifiers: Rubocop, Ruby Beautify

Selected Beautifier: Rubocop

Original File Contents

require 'rails_helper'

RSpec.describe CampaignsController, type: :controller do
  let(:valid_attributes) do
    {
      name: 'My Campaign',
      url: 'http://example.com',
      utm_campaign: 'my_campaign',
      utm_source: 'my_source',
      utm_medium: 'sms'
    }
  end

  let(:invalid_attributes) do
    {
      name: nil,
      url: "invalid",
      utm_campaign: nil,
      utm_source: nil,
      utm_medium: nil
    }
  end

  # (...truncated)

end

Package Settings

The raw package settings options

{
    "_analyticsUserId": "c74edefc-32be-466d-b24e-c5f68cecb104",
    "analytics": true,
    "_loggerLevel": "warn",
    "beautifyEntireFileOnSave": true,
    "muteUnsupportedLanguageErrors": false,
    "muteAllErrors": false,
    "arduino_configPath": "",
    "cs_configPath": "",
    "c_configPath": "",
    "cpp_configPath": "",
    "css_indent_size": 2,
    "css_indent_char": " ",
    "css_selector_separator_newline": false,
    "css_newline_between_rules": false,
    "css_preserve_newlines": false,
    "css_wrap_line_length": 0,
    "css_indent_comments": true,
    "css_force_indentation": false,
    "css_convert_quotes": "none",
    "css_align_assignments": false,
    "css_no_lead_zero": false,
    "css_configPath": "",
    "css_predefinedConfig": "csscomb",
    "d_configPath": "",
    "gherkin_indent_size": 2,
    "gherkin_indent_char": " ",
    "fortran_emacs_path": "",
    "fortran_emacs_script_path": "",
    "html_indent_inner_html": false,
    "html_indent_size": 2,
    "html_indent_char": " ",
    "html_brace_style": "collapse",
    "html_indent_scripts": "normal",
    "html_wrap_line_length": 250,
    "html_wrap_attributes": "auto",
    "html_wrap_attributes_indent_size": 2,
    "html_preserve_newlines": true,
    "html_max_preserve_newlines": 10,
    "html_unformatted": [
        "a",
        "span",
        "img",
        "bdo",
        "em",
        "strong",
        "dfn",
        "code",
        "samp",
        "kbd",
        "var",
        "cite",
        "abbr",
        "acronym",
        "q",
        "sub",
        "sup",
        "tt",
        "i",
        "b",
        "big",
        "small",
        "u",
        "s",
        "strike",
        "font",
        "ins",
        "del",
        "pre",
        "address",
        "dt",
        "h1",
        "h2",
        "h3",
        "h4",
        "h5",
        "h6"
    ],
    "html_end_with_newline": false,
    "html_extra_liners": [
        "head",
        "body",
        "/html"
    ],
    "java_configPath": "",
    "js_indent_size": 2,
    "js_indent_char": " ",
    "js_indent_level": 0,
    "js_indent_with_tabs": false,
    "js_preserve_newlines": true,
    "js_max_preserve_newlines": 10,
    "js_space_in_paren": false,
    "js_jslint_happy": false,
    "js_space_after_anon_function": false,
    "js_brace_style": "collapse",
    "js_break_chained_methods": false,
    "js_keep_array_indentation": false,
    "js_keep_function_indentation": false,
    "js_space_before_conditional": true,
    "js_eval_code": false,
    "js_unescape_strings": false,
    "js_wrap_line_length": 0,
    "js_end_with_newline": false,
    "js_end_with_comma": false,
    "objectivec_configPath": "",
    "pawn_configPath": "",
    "perl_perltidy_profile": "",
    "php_cs_fixer_path": "",
    "php_fixers": "",
    "php_level": "",
    "python_max_line_length": 79,
    "python_indent_size": 4,
    "python_ignore": [
        "E24"
    ],
    "python_sort_imports": false,
    "ruby_indent_size": 2,
    "ruby_rubocop_path": "",
    "ruby_indent_char": " ",
    "rust_rustfmt_path": "",
    "sql_indent_size": 2,
    "sql_keywords": "upper",
    "sql_identifiers": "lower",
    "vala_configPath": "",
    "language_arduino_disabled": false,
    "language_arduino_default_beautifier": "Uncrustify",
    "language_arduino_beautify_on_save": false,
    "language_cs_disabled": false,
    "language_cs_default_beautifier": "Uncrustify",
    "language_cs_beautify_on_save": false,
    "language_c_disabled": false,
    "language_c_default_beautifier": "Uncrustify",
    "language_c_beautify_on_save": false,
    "language_coffeescript_disabled": false,
    "language_coffeescript_default_beautifier": "coffee-fmt",
    "language_coffeescript_beautify_on_save": false,
    "language_cpp_disabled": false,
    "language_cpp_default_beautifier": "Uncrustify",
    "language_cpp_beautify_on_save": false,
    "language_css_disabled": false,
    "language_css_default_beautifier": "JS Beautify",
    "language_css_beautify_on_save": false,
    "language_csv_disabled": false,
    "language_csv_default_beautifier": "Pretty Diff",
    "language_csv_beautify_on_save": false,
    "language_d_disabled": false,
    "language_d_default_beautifier": "Uncrustify",
    "language_d_beautify_on_save": false,
    "language_ejs_disabled": false,
    "language_ejs_default_beautifier": "Pretty Diff",
    "language_ejs_beautify_on_save": false,
    "language_elm_disabled": false,
    "language_elm_default_beautifier": "elm-format",
    "language_elm_beautify_on_save": false,
    "language_erb_disabled": false,
    "language_erb_default_beautifier": "Pretty Diff",
    "language_erb_beautify_on_save": false,
    "language_gherkin_disabled": false,
    "language_gherkin_default_beautifier": "Gherkin formatter",
    "language_gherkin_beautify_on_save": false,
    "language_go_disabled": false,
    "language_go_default_beautifier": "gofmt",
    "language_go_beautify_on_save": false,
    "language_fortran_disabled": false,
    "language_fortran_default_beautifier": "Fortran Beautifier",
    "language_fortran_beautify_on_save": false,
    "language_handlebars_disabled": false,
    "language_handlebars_default_beautifier": "JS Beautify",
    "language_handlebars_beautify_on_save": false,
    "language_haskell_disabled": false,
    "language_haskell_default_beautifier": "stylish-haskell",
    "language_haskell_beautify_on_save": false,
    "language_html_disabled": false,
    "language_html_default_beautifier": "JS Beautify",
    "language_html_beautify_on_save": false,
    "language_java_disabled": false,
    "language_java_default_beautifier": "Uncrustify",
    "language_java_beautify_on_save": false,
    "language_js_disabled": false,
    "language_js_default_beautifier": "JS Beautify",
    "language_js_beautify_on_save": false,
    "language_json_disabled": false,
    "language_json_default_beautifier": "JS Beautify",
    "language_json_beautify_on_save": false,
    "language_jsx_disabled": false,
    "language_jsx_default_beautifier": "Pretty Diff",
    "language_jsx_beautify_on_save": false,
    "language_less_disabled": false,
    "language_less_default_beautifier": "Pretty Diff",
    "language_less_beautify_on_save": false,
    "language_markdown_disabled": false,
    "language_markdown_default_beautifier": "Tidy Markdown",
    "language_markdown_beautify_on_save": false,
    "language_marko_disabled": false,
    "language_marko_default_beautifier": "JS Beautify",
    "language_marko_beautify_on_save": false,
    "language_mustache_disabled": false,
    "language_mustache_default_beautifier": "JS Beautify",
    "language_mustache_beautify_on_save": false,
    "language_objectivec_disabled": false,
    "language_objectivec_default_beautifier": "Uncrustify",
    "language_objectivec_beautify_on_save": false,
    "language_pawn_disabled": false,
    "language_pawn_default_beautifier": "Uncrustify",
    "language_pawn_beautify_on_save": false,
    "language_perl_disabled": false,
    "language_perl_default_beautifier": "Perltidy",
    "language_perl_beautify_on_save": false,
    "language_php_disabled": false,
    "language_php_default_beautifier": "PHP-CS-Fixer",
    "language_php_beautify_on_save": false,
    "language_puppet_disabled": false,
    "language_puppet_default_beautifier": "puppet-lint",
    "language_puppet_beautify_on_save": false,
    "language_python_disabled": false,
    "language_python_default_beautifier": "autopep8",
    "language_python_beautify_on_save": false,
    "language_ruby_disabled": false,
    "language_ruby_default_beautifier": "Rubocop",
    "language_ruby_beautify_on_save": false,
    "language_rust_disabled": false,
    "language_rust_default_beautifier": "rustfmt",
    "language_rust_beautify_on_save": false,
    "language_sass_disabled": false,
    "language_sass_default_beautifier": "Pretty Diff",
    "language_sass_beautify_on_save": false,
    "language_scss_disabled": false,
    "language_scss_default_beautifier": "Pretty Diff",
    "language_scss_beautify_on_save": false,
    "language_spacebars_disabled": false,
    "language_spacebars_default_beautifier": "Pretty Diff",
    "language_spacebars_beautify_on_save": false,
    "language_sql_disabled": false,
    "language_sql_default_beautifier": "sqlformat",
    "language_sql_beautify_on_save": false,
    "language_svg_disabled": false,
    "language_svg_default_beautifier": "Pretty Diff",
    "language_svg_beautify_on_save": false,
    "language_swig_disabled": false,
    "language_swig_default_beautifier": "Pretty Diff",
    "language_swig_beautify_on_save": false,
    "language_tss_disabled": false,
    "language_tss_default_beautifier": "Pretty Diff",
    "language_tss_beautify_on_save": false,
    "language_twig_disabled": false,
    "language_twig_default_beautifier": "Pretty Diff",
    "language_twig_beautify_on_save": false,
    "language_typescript_disabled": false,
    "language_typescript_default_beautifier": "TypeScript Formatter",
    "language_typescript_beautify_on_save": false,
    "language_vala_disabled": false,
    "language_vala_default_beautifier": "Uncrustify",
    "language_vala_beautify_on_save": false,
    "language_visualforce_disabled": false,
    "language_visualforce_default_beautifier": "Pretty Diff",
    "language_visualforce_beautify_on_save": false,
    "language_xml_disabled": false,
    "language_xml_default_beautifier": "Pretty Diff",
    "language_xml_beautify_on_save": false
}

Beautification options

Editor Options:
Options from Atom Editor settings

{
    "_default": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_with_tabs": false
    }
}

Config Options:
Options from Atom Beautify package settings

{
    "arduino": {
        "configPath": ""
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "css": {
        "indent_size": 2,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false,
        "wrap_line_length": 0,
        "indent_comments": true,
        "force_indentation": false,
        "convert_quotes": "none",
        "align_assignments": false,
        "no_lead_zero": false,
        "configPath": "",
        "predefinedConfig": "csscomb"
    },
    "d": {
        "configPath": ""
    },
    "gherkin": {
        "indent_size": 2,
        "indent_char": " "
    },
    "fortran": {
        "emacs_path": "",
        "emacs_script_path": ""
    },
    "html": {
        "indent_inner_html": false,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "span",
            "img",
            "bdo",
            "em",
            "strong",
            "dfn",
            "code",
            "samp",
            "kbd",
            "var",
            "cite",
            "abbr",
            "acronym",
            "q",
            "sub",
            "sup",
            "tt",
            "i",
            "b",
            "big",
            "small",
            "u",
            "s",
            "strike",
            "font",
            "ins",
            "del",
            "pre",
            "address",
            "dt",
            "h1",
            "h2",
            "h3",
            "h4",
            "h5",
            "h6"
        ],
        "end_with_newline": false,
        "extra_liners": [
            "head",
            "body",
            "/html"
        ]
    },
    "java": {
        "configPath": ""
    },
    "js": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false,
        "end_with_comma": false
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "php": {
        "cs_fixer_path": "",
        "fixers": "",
        "level": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 4,
        "ignore": [
            "E24"
        ],
        "sort_imports": false
    },
    "ruby": {
        "indent_size": 2,
        "rubocop_path": "",
        "indent_char": " "
    },
    "rust": {
        "rustfmt_path": ""
    },
    "sql": {
        "indent_size": 2,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options:
Options from /Users/jemminger/.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options:
Options from EditorConfig file

{
    "_default": {}
}

Project Options:
Options from .jsbeautifyrc files starting from directory /Users/jemminger/Rails/new_tsig/spec/controllers and going up to root

[
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    }
]

Pre-Transformed Options:
Combined options before transforming them given a beautifier's specifications

{
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false,
    "rubocop_path": ""
}

Final Options

Final combined and transformed options that are used

{
    "indent_size": 2,
    "rubocop_path": ""
}

Results

Beautified File Contents:

require 'rails_helper'

RSpec.describe CampaignsController, type: :controller do
  let(:valid_attributes) do
    {
      name: 'My Campaign',
      url: 'http://example.com',
      utm_campaign: 'my_campaign',
      utm_source: 'my_source',
      utm_medium: 'sms'
    }
  end

  let(:invalid_attributes) do
    {
      name: nil,
      url: 'invalid',
      utm_campaign: nil,
      utm_source: nil,
      utm_medium: nil
    }
  end

  # (...truncated)
end

Original vs. Beautified Diff:

Index: /Users/jemminger/Rails/new_tsig/spec/controllers/campaigns_controller_spec.rb
===================================================================
--- /Users/jemminger/Rails/new_tsig/spec/controllers/campaigns_controller_spec.rb   original
+++ /Users/jemminger/Rails/new_tsig/spec/controllers/campaigns_controller_spec.rb   beautified
@@ -13,14 +13,13 @@

   let(:invalid_attributes) do
     {
       name: nil,
-      url: "invalid",
+      url: 'invalid',
       utm_campaign: nil,
       utm_source: nil,
       utm_medium: nil
     }
   end

   # (...truncated)
-
 end

Logs

2016-02-09T20:09:51.280Z - info: [beautifiers/index.coffee] beautify require 'rails_helper'

RSpec.describe CampaignsController, type: :controller do
  let(:valid_attributes) do
    {
      name: 'My Campaign',
      url: 'http://example.com',
      utm_campaign: 'my_campaign',
      utm_source: 'my_source',
      utm_medium: 'sms'
    }
  end

  let(:invalid_attributes) do
    {
      name: nil,
      url: "invalid",
      utm_campaign: nil,
      utm_source: nil,
      utm_medium: nil
    }
  end

  # (...truncated)

end
 [ { _default: { indent_size: 2, indent_char: ' ', indent_with_tabs: false } },
  { arduino: { configPath: '' },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    css: 
     { indent_size: 2,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false,
       wrap_line_length: 0,
       indent_comments: true,
       force_indentation: false,
       convert_quotes: 'none',
       align_assignments: false,
       no_lead_zero: false,
       configPath: '',
       predefinedConfig: 'csscomb' },
    d: { configPath: '' },
    gherkin: { indent_size: 2, indent_char: ' ' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false,
       extra_liners: [Object] },
    java: { configPath: '' },
    js: 
     { indent_size: 2,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       space_after_anon_function: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false,
       end_with_comma: false },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    php: { cs_fixer_path: '', fixers: '', level: '' },
    python: 
     { max_line_length: 79,
       indent_size: 4,
       ignore: [Object],
       sort_imports: false },
    ruby: { indent_size: 2, rubocop_path: '', indent_char: ' ' },
    rust: { rustfmt_path: '' },
    sql: { indent_size: 2, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] Ruby on Rails /Users/jemminger/Rails/new_tsig/spec/controllers/campaigns_controller_spec.rb undefined
2016-02-09T20:09:51.280Z - verbose: [beautifiers/index.coffee]  indent_size=2, indent_char= , indent_with_tabs=false, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], end_with_newline=false, extra_liners=[head, body, /html], configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , , , , , 
2016-02-09T20:09:51.282Z - verbose: [beautifiers/index.coffee] [ { name: 'Ruby',
    namespace: 'ruby',
    grammars: [ 'Ruby', 'Ruby on Rails' ],
    extensions: [ 'rb' ],
    options: 
     { indent_size: [Object],
       rubocop_path: [Object],
       indent_char: [Object] },
    beautifiers: [ 'Rubocop', 'Rubocop', 'Ruby Beautify', 'Ruby Beautify' ] } ] 'Ruby on Rails' 'rb'
2016-02-09T20:09:51.282Z - verbose: [beautifiers/index.coffee] Language Ruby supported
2016-02-09T20:09:51.282Z - verbose: [beautifiers/index.coffee] getOptions selections [ 'ruby' ] indent_size=2, indent_char= , indent_with_tabs=false, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], end_with_newline=false, extra_liners=[head, body, /html], configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , , , , , 
2016-02-09T20:09:51.283Z - verbose: [beautifiers/index.coffee] true indent_size=2, indent_char= , indent_with_tabs=false
2016-02-09T20:09:51.283Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.283Z - verbose: [beautifiers/index.coffee] options ruby indent_size=2, indent_char= , indent_with_tabs=false
2016-02-09T20:09:51.284Z - verbose: [beautifiers/index.coffee] true configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], end_with_newline=false, extra_liners=[head, body, /html], configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=
2016-02-09T20:09:51.284Z - verbose: [beautifiers/index.coffee] options ruby indent_size=2, rubocop_path=, indent_char= 
2016-02-09T20:09:51.284Z - verbose: [beautifiers/index.coffee] options ruby indent_size=2, rubocop_path=, indent_char= 
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.285Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.286Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] true 
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] options ruby undefined
2016-02-09T20:09:51.287Z - verbose: [beautifiers/index.coffee] options ruby
2016-02-09T20:09:51.288Z - verbose: [beautifiers/index.coffee] Ruby on Rails name=Ruby, namespace=ruby, grammars=[Ruby, Ruby on Rails], extensions=[rb], type=integer, default=2, minimum=0, description=Indentation size/length (Supported by Rubocop, Ruby Beautify), title=Ruby - Indent size, beautifiers=[Rubocop, Ruby Beautify], key=indent_size, $ref=$, title=Ruby - Rubocop Path, type=string, default=, description=Path to the `rubocop` CLI executable (Supported by Rubocop), beautifiers=[Rubocop], key=rubocop_path, $ref=$, type=string, default= , description=Indentation character (Supported by Ruby Beautify), enum=[ ,   ], title=Ruby - Indent char, beautifiers=[Ruby Beautify], key=indent_char, $ref=$, beautifiers=[Rubocop, Rubocop, Ruby Beautify, Ruby Beautify]
2016-02-09T20:09:51.288Z - verbose: [beautifiers/index.coffee] language options: {
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false,
    "rubocop_path": ""
}
2016-02-09T20:09:51.289Z - verbose: [beautifiers/index.coffee] Ruby /Users/jemminger/Rails/new_tsig/spec/controllers/campaigns_controller_spec.rb { indent_size: 2,
  indent_char: ' ',
  indent_with_tabs: false,
  rubocop_path: '' } indent_size=2, indent_char= , indent_with_tabs=false, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], end_with_newline=false, extra_liners=[head, body, /html], configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , , , , , 
2016-02-09T20:09:51.289Z - verbose: [beautifiers/index.coffee] beautifiers 0=Rubocop, 1=Ruby Beautify
2016-02-09T20:09:51.290Z - verbose: [beautifiers/index.coffee] beautifier Rubocop
2016-02-09T20:09:51.954Z - debug: [beautifiers/beautifier.coffee] rubocop paths 0=undefined, 1=/Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop
2016-02-09T20:09:51.955Z - verbose: [beautifiers/beautifier.coffee] rubocopPath /Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop
2016-02-09T20:09:51.955Z - debug: [beautifiers/beautifier.coffee] rubocopPath /Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop 0=undefined, 1=/Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop
2016-02-09T20:09:51.961Z - debug: [beautifiers/beautifier.coffee] rubocop { 'Style/IndentationWidth': { Width: 2 } } _bitField=0, _fulfillmentHandler0=undefined, _rejectionHandler0=undefined, _progressHandler0=undefined, _promise0=undefined, _receiver0=undefined, _settledValue=undefined
2016-02-09T20:09:51.964Z - debug: [beautifiers/beautifier.coffee] tempFile rubocop-config null path=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/rubocop-config11619-2009-1f65xta, fd=131
2016-02-09T20:09:51.964Z - debug: [beautifiers/beautifier.coffee] tempFile temp null path=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5, fd=132
2016-02-09T20:09:51.966Z - debug: [beautifiers/beautifier.coffee] exeName, args: /Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop 0=--auto-correct, 1=--config, 2=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/rubocop-config11619-2009-1f65xta, 3=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5
2016-02-09T20:09:51.967Z - debug: [beautifiers/beautifier.coffee] exePath, env: /Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop rvm_bin_path=/Users/jemminger/.rvm/bin, GEM_HOME=/Users/jemminger/.rvm/gems/ruby-2.2.0, ANDROID_HOME=/Users/jemminger/Development/android-sdk-macosx, SHELL=/bin/bash, IRBRC=/Users/jemminger/.rvm/rubies/ruby-2.2.0/.irbrc, TMPDIR=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Fsu7SBVZw6/Render, MY_RUBY_HOME=/Users/jemminger/.rvm/rubies/ruby-2.2.0, ATOM_HOME=/Users/jemminger/.atom, rvm_stored_umask=0022, USER=jemminger, _system_type=Darwin, rvm_path=/Users/jemminger/.rvm, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.7Niw183PUy/Listeners, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, rvm_prefix=/Users/jemminger, GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q, PATH=/Users/jemminger/.rvm/gems/ruby-2.2.0/bin:/Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin:/Users/jemminger/.rvm/rubies/ruby-2.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jemminger/Development/android-sdk-macosx/tools:/Users/jemminger/Development/android-sdk-macosx/platform-tools:/Users/jemminger/Development/android-sdk-macosx/build-tools/22.0.0:/Users/jemminger/.rvm/bin, rvm_loaded_flag=1, PWD=/, NODE_PATH=/Applications/Atom.app/Contents/Resources/app.asar/exports, _system_arch=x86_64, XPC_FLAGS=0x0, NODE_ENV=production, _system_version=10.10, RUBY_GC_HEAP_INIT_SLOTS=2000000, XPC_SERVICE_NAME=0, rvm_version=1.26.11 (master), RUBY_HEAP_SLOTS_INCREMENT=500000, SHLVL=1, HOME=/Users/jemminger, LOGNAME=jemminger, GEM_PATH=/Users/jemminger/.rvm/gems/ruby-2.2.0:/Users/jemminger/.rvm/gems/ruby-2.2.0@global, RUBY_GC_MALLOC_LIMIT=90000000, RUBY_HEAP_SLOTS_GROWTH_FACTOR=1, RUBY_VERSION=ruby-2.2.0, RUBY_GC_HEAP_FREE_SLOTS=100000, rvm_user_install_flag=1, _system_name=OSX, _=/usr/bin/env
2016-02-09T20:09:51.968Z - debug: [beautifiers/beautifier.coffee] spawn /Users/jemminger/.rvm/gems/ruby-2.2.0@global/bin/rubocop 0=--auto-correct, 1=--config, 2=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/rubocop-config11619-2009-1f65xta, 3=/var/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5
2016-02-09T20:09:54.072Z - debug: [beautifiers/beautifier.coffee] spawn done 1  Inspecting 1 file
C

Offenses:

ar/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5:1:1: C: Use snake_case for source file names.
require 'rails_helper'
^
ar/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5:17:12: C: [Corrected] Prefer single-quoted strings when you don't need string interpolation or special symbols.
      url: "invalid",
           ^^^^^^^^^
ar/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5:25:1: C: [Corrected] Extra empty line detected at block body end.

1 file inspected, 3 offenses detected, 2 offenses corrected

2016-02-09T20:09:54.072Z - verbose: [beautifiers/beautifier.coffee] spawn result 1 Inspecting 1 file
C

Offenses:

ar/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5:1:1: C: Use snake_case for source file names.
require 'rails_helper'
^
ar/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5:17:12: C: [Corrected] Prefer single-quoted strings when you don't need string interpolation or special symbols.
      url: "invalid",
           ^^^^^^^^^
ar/folders/1c/3zlw12tx4g9918xhc8bwnyj00000gn/T/temp11619-2009-1svynk5:25:1: C: [Corrected] Extra empty line detected at block body end.

1 file inspected, 3 offenses detected, 2 offenses corrected


@jemminger
Copy link
Author

Rubocop from the command line works as expected:

mac-n-cheese:new_tsig jemminger$ rubocop spec/controllers/campaigns_controller_spec.rb 
Inspecting 1 file
C

Offenses:

spec/controllers/campaigns_controller_spec.rb:1:9: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
require 'rails_helper'
        ^^^^^^^^^^^^^^
spec/controllers/campaigns_controller_spec.rb:6:13: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      name: 'My Campaign',
            ^^^^^^^^^^^^^
spec/controllers/campaigns_controller_spec.rb:7:12: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      url: 'http://example.com',
           ^^^^^^^^^^^^^^^^^^^^
spec/controllers/campaigns_controller_spec.rb:8:21: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      utm_campaign: 'my_campaign',
                    ^^^^^^^^^^^^^
spec/controllers/campaigns_controller_spec.rb:9:19: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      utm_source: 'my_source',
                  ^^^^^^^^^^^
spec/controllers/campaigns_controller_spec.rb:10:19: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
      utm_medium: 'sms'
                  ^^^^^

1 file inspected, 6 offenses detected

@mrx88
Copy link

mrx88 commented Apr 17, 2016

I have exactly the same issue. Any plans fixing it?

@Glavin001
Copy link
Owner

The applicable file that needs changing is https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/rubocop.coffee
I would be open to reviewing and merging a Pull Request resolving this issue. Thanks in advance.

@CJYate
Copy link

CJYate commented Sep 21, 2016

Hi
I don't see any errors. But Rubocop does literally /nothing/ in this context, other than complain at me through the linter (which I've turned off) about things that its formatter ought to fix. I've set up the path to my gem etc.

In order to diagnose it, how can I see any output that Rubocop might make via this plugin?

@Glavin001
Copy link
Owner

@cjbrew : Create a debug.md Gist which includes debugging information that answers our most commonly asked questions. See https://github.com/Glavin001/atom-beautify/blob/master/docs/troubleshooting.md#how-to-create-debugmd-gist for details.
Thank you.

@CJYate
Copy link

CJYate commented Dec 30, 2016

@Glavin001 thanks, I've just noticed your reply. I'll try to get you a debug output, if I can still reproduce the issue next week.

@Glavin001
Copy link
Owner

Glavin001 commented Jan 3, 2017

It looks like .rubocop.yml is only found from the first project's path instead of including home directory: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/rubocop.coffee#L31
This can be improved to find .rubocop.yml file by looking recursively up directories. See

configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
for example.
I would be happy to review and merge someone's Pull Request implementing this improvement. Let me know if you have any questions!

@dfang
Copy link

dfang commented Jun 10, 2017

so am i ...

@stale
Copy link

stale bot commented Nov 4, 2017

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 4, 2017
@stale stale bot closed this as completed Nov 11, 2017
@orkenstein
Copy link

Have the same issue. Any fixes?

@jemminger
Copy link
Author

My fix was to switch to VS Code :/

@Glavin001
Copy link
Owner

Published to v0.32.0

See #1776.

@Glavin001 Glavin001 reopened this Mar 2, 2018
@stale stale bot removed the stale label Mar 2, 2018
@Glavin001 Glavin001 added this to the v0.32.0 milestone Mar 2, 2018
@Glavin001 Glavin001 self-assigned this Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants