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

rubocop returns empty output! please check configuration. #132

Open
resistorsoftware opened this issue Oct 8, 2020 · 11 comments
Open

rubocop returns empty output! please check configuration. #132

resistorsoftware opened this issue Oct 8, 2020 · 11 comments

Comments

@resistorsoftware
Copy link

resistorsoftware commented Oct 8, 2020

rubocop gem version 0.80.1

At the command line I do a which rubucop and get my path:

/Users/sodapop/.rvm/gems/ruby-2.7.0/bin/rubocop

It works fine. If I paste that into the User and Workspace settings for the path:

/Users/sodapop/.rvm/gems/ruby-2.7.0/bin/

I get the error rubocop returns empty output! please check configuration.

I am not sure why this is. This extension seems unable to activate rubocop correctly. What is typically wrong with configurations where you provide the correct path to the executable, but get empty output?

@zhelyan
Copy link

zhelyan commented Oct 8, 2020

seems to be caused by

Error: Error parsing autocorrection from CLI: 
{
  "metadata": {
    "rubocop_version": "0.92.0",
    "ruby_engine": "ruby",
    "ruby_version": "2.7.1",
    "ruby_patchlevel": "83",
    "ruby_platform": "x86_64-darwin19"
  },
  "files": [
    {
      "path": "lib/foo/bar.rb",
      "offenses": [
        {
          "severity": "convention",
          "message": "Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions)",
          "cop_name": "Layout/IndentationConsistency",
          "corrected": true,
          "correctable": true,
          "location": {
            "start_line": 17,
            "start_column": 7,
            "last_line": 29,
            "last_column": 11,
            "length": 622,
            "line": 17,
            "column": 7
          }
        }
  ],
  "summary": {
    "offense_count": 1,
    "target_file_count": 1,
    "inspected_file_count": 1
  }
}

	at RubocopAutocorrectProvider.onSuccess (/Users/me/.vscode/extensions/misogi.ruby-rubocop-0.8.4/out/src/rubocop.js:54:19)

@psolvy
Copy link

psolvy commented Oct 12, 2020

seems to be caused by

Error: Error parsing autocorrection from CLI: 
{
  "metadata": {
    "rubocop_version": "0.92.0",
    "ruby_engine": "ruby",
    "ruby_version": "2.7.1",
    "ruby_patchlevel": "83",
    "ruby_platform": "x86_64-darwin19"
  },
  "files": [
    {
      "path": "lib/foo/bar.rb",
      "offenses": [
        {
          "severity": "convention",
          "message": "Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions)",
          "cop_name": "Layout/IndentationConsistency",
          "corrected": true,
          "correctable": true,
          "location": {
            "start_line": 17,
            "start_column": 7,
            "last_line": 29,
            "last_column": 11,
            "length": 622,
            "line": 17,
            "column": 7
          }
        }
  ],
  "summary": {
    "offense_count": 1,
    "target_file_count": 1,
    "inspected_file_count": 1
  }
}

	at RubocopAutocorrectProvider.onSuccess (/Users/me/.vscode/extensions/misogi.ruby-rubocop-0.8.4/out/src/rubocop.js:54:19)

same with rubocop 0.92.0

@AndreeWille
Copy link

AndreeWille commented Oct 21, 2020

seems to be caused by

Error: Error parsing autocorrection from CLI: 
{
  "metadata": {
    "rubocop_version": "0.92.0",
    "ruby_engine": "ruby",
    "ruby_version": "2.7.1",
    "ruby_patchlevel": "83",
    "ruby_platform": "x86_64-darwin19"
  },
  "files": [
    {
      "path": "lib/foo/bar.rb",
      "offenses": [
        {
          "severity": "convention",
          "message": "Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions)",
          "cop_name": "Layout/IndentationConsistency",
          "corrected": true,
          "correctable": true,
          "location": {
            "start_line": 17,
            "start_column": 7,
            "last_line": 29,
            "last_column": 11,
            "length": 622,
            "line": 17,
            "column": 7
          }
        }
  ],
  "summary": {
    "offense_count": 1,
    "target_file_count": 1,
    "inspected_file_count": 1
  }
}

	at RubocopAutocorrectProvider.onSuccess (/Users/me/.vscode/extensions/misogi.ruby-rubocop-0.8.4/out/src/rubocop.js:54:19)

I get this error everytime i save a ruby file. Also formatting a ruby file does not work because of this error.

rubocop: 0.92.0
vs-ruby-rubocop: 0.8.4
OS: WSL2 with Ubuntu 20.04 on Windows 10

@ngouy
Copy link
Contributor

ngouy commented Oct 23, 2020

see #131, it should fix ur issue. It's in fact a dup of #123

@jonstump
Copy link

I'm still seeing this message and I set up my settings.json to point to /home/jmstump/.rbenv/shims/

Rubocop runs in other editors so it seems to be either related to the extension or my setup of it.

@ngouy
Copy link
Contributor

ngouy commented Apr 1, 2021

I see it pop time to time since some days also, my guess is that there is something that broke again, but it's not consistent on my machine (depend on the content of the file itself and the rubocop version is seems)

If you find a way to 100% reproduce it would be glad to help and try find what is missing

@jonstump
Copy link

jonstump commented Apr 1, 2021

@ngouy I ended up disabling linting in ruby altogether because a recent update broke it while using live share (basically the only reason I use VSCode). I'll see if I can give it another try and get you some more information.

@DRBragg
Copy link

DRBragg commented Apr 1, 2021

Just started getting this pop up after the last VSCode update (1.55.0)

@ngouy
Copy link
Contributor

ngouy commented Apr 2, 2021

I am a bit underwater rn and it works for me so ... Will probably check it out when it will break for me and it makes me loses time. Sorry guys

For the live share it's way out of my reach, sorry

@filipemendespi
Copy link

I tried several solutions and I was only able to solve the problem by removing the visual code via flatpak and downloading the .deb.
In my case I am using pop_os.

@yangjindong
Copy link

This worked for me according this post:

{
  // If not specified searches for 'rubocop' executable available on PATH (default and recommended)
  "ruby.rubocop.executePath": "",
  ...
}

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

No branches or pull requests

9 participants