代码之家  ›  专栏  ›  技术社区  ›  Edin DzeJoe'

为什么在VSCODE中解析输出(可能是非JSON输出)时出错

  •  0
  • Edin DzeJoe'  · 技术社区  · 8 年前

    安装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
    }
    

    此内容位于文件中。鲁博科普。yml公司

    AllCops:
      Exclude:
        - 'vendor/**/*'
        - 'spec/fixtures/**/*'
        - 'tmp/**/*'
        - 'db/schema.rb'
        - 'db/migrate/**/*'
        - 'lib/tasks/**/*'
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   Determinant    8 年前

    我有这个错误,问题是代码中有太多的违规行为。

    解决方案是从命令行运行rubocop,纠正足够多的违规行为,直到扩展能够管理为止。我用过 rubocop —auto-correct filename.rb 纠正许多错误。

    我看到其他人在用于VS代码RubyRubocop扩展的GitHub问题跟踪程序上使用不同的解决方案来解决此错误。