chef/vscode-chef

Rubocop is not working

mudricd opened this issue · 5 comments

Rubocop on Visual Studio Code with Chef Infra Extension for Visual Studio Code is not working

Describe the problem

I installed Chef Infra Extension for Visual Studio Code extension and everything works fine apart from rubocop. I have MAC and I changed the executable path which is /usr/local/bin/rubocop but still no luck.

Software Version

I am using MAC OS Mojave Version 10.14.6
VSC Version: 1.40.2

Replication Case

I intensely wrote the false code but it was not underlined and there was no sign of rubocop.

@mudricd is this still occurring? And do you have any expectation that this is set up automatically, or are you saying that when you set up rubocop, it doesn't get invoked when Chef Infra Extension is installed?

I've got the same issue:

If I just run the Ruby extension (and disable the Chef extension) - rubocop runs and displays issues but doesn't use the cookstyle rules. That's fine and is to be expected I guess.

When the Chef extension is installed/enabled I don't see anything from the linter.

  • I've tried specifying the path to rubocop
  • I've tried to generate a cookstyle config cookstyle --auto-gen-config and then selectively re-enable the disabled checks
  • I've tried to increase the rubocop.fileCountThreshold setting

Nothing has worked. I still see no errors in my file.

I'm using VSCode on windows and using the Remote SSH Extension to SSH into an Ubuntu 20.04 machine. The chef code is hosted on the Ubuntu machine.

Seems to working now.

I set rubocop path to point to cookstyle instead and it seems to work.
"rubocop.path": "/opt/chef-workstation/bin/cookstyle"

I'm having a similar issue here, no formatting when the Chef Infra Extension is enabled. If I disable that Rubocop works with the default Ruby extension. I installed cookstyle and updated my path like the last comment suggested but still I do not see any formatting option in the right click menu. What am I missing here?

Command 'Chef: Validate Workspace' resulted in an error (command 'chef.validateEntireWorkspace' not found)