【问题标题】:Why i get Error on parsing output (It might non-JSON output) in VSCODE为什么我在 VSCODE 中解析输出时出错(可能是非 JSON 输出)
【发布时间】:2018-01-26 09:27:17
【问题描述】:

安装 Rubocop 扩展后。我在 VS 代码中收到警告警报。

Error on parsing output (It might non-JSON output) : "{"metadata":{"rubocop_version":"0.52.1","ruby_engine":"ruby","ruby_version":"2.4.1","ruby_patchlevel"

这是我的文件工作区设置

{
    "ruby.rubocop.executePath": "/Users/foo/.rvm/gems/ruby-2.4.1/bin/",
    "ruby.rubocop.configFilePath": "/Users/foo/git/project_name/.rubocop.yml",
    "ruby.rubocop.onSave": true
}

文件 .rubocop.yml 中的此内容

AllCops:
  Exclude:
    - 'vendor/**/*'
    - 'spec/fixtures/**/*'
    - 'tmp/**/*'
    - 'db/schema.rb'
    - 'db/migrate/**/*'
    - 'lib/tasks/**/*'

【问题讨论】:

    标签: ruby visual-studio-code rubocop


    【解决方案1】:

    我遇到了这个错误,问题是代码中有太多“冒犯”。

    解决方案是从命令行运行 rubocop 并纠正足够多的攻击,直到它可以被扩展程序管理。我用rubocop —auto-correct filename.rb纠正了很多错误。

    我在 VS Code ruby​​-rubocop 扩展的 GitHub 问题跟踪器上看到其他人使用不同的解决方案来解决此错误。

    【讨论】:

      猜你喜欢
      • 2021-12-21
      • 1970-01-01
      • 1970-01-01
      • 2016-02-11
      • 1970-01-01
      • 2013-04-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-18
      相关资源
      最近更新 更多