Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Standard should use the --no-fix argument when linting #447

@wadetandy

Description

@wadetandy

Your environment

  • vscode-ruby version: 0.22.2
  • Ruby version: MRI 2.5.1
  • Ruby version manager (if any): rvm
  • VS Code version: 1.31.1
  • Operating System: OSX
  • Using language server? Yes

Expected behavior

When using vscode-ruby with standard rb and the following extension settings:

{
  "ruby.format": "standard",
  "ruby.lint": {
    "standard": true
  },
  "ruby.useLanguageServer": true,
}

I would expect updates to the file to run and show linter errors if present.

Actual behavior

When running against files in this project (I haven't verified with all of them, but any I've tried), the Ruby Language Server sends the following output when opening or changing a file. The below example is specifically for this file.

Lint: executing standardrb -s <project_root>/lib/graphiti/railtie.rb -f json...
Lint: Received invalid JSON from standardrb:

{"metadata":{"rubocop_version":"0.65.0","ruby_engine":"ruby","ruby_version":"2.5.1","ruby_patchlevel":"57","ruby_platform":"x86_64-darwin17"},"files":[{"path":"lib/graphiti/railtie.rb","offenses":[]}],"summary":{"offense_count":0,"target_file_count":1,"inspected_file_count":1}}====================
module Graphiti
  class Railtie < ::Rails::Railtie
    rake_tasks do
      path = File.expand_path(__dir__)
... rest of file contents for the current file ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions