Vscode (vscode-ruby + rubocop) how to auto-adjust when saved?

Wednesday

  • vscode Version 1.19.1 (1.19.1)
  • rubocop (0.52.1)
  • Darwin mbp 16.7.0 The core of Darwin Version 16.7.0: cf. Oct 4 00:17:00 PDT 2017; root: xnu-3789.71.6 ~ 1 / RELEASE_X86_64 x86_64
  • ruby 2.3.5p376 (version 2017-09-14 version 59905) [x86_64-darwin16]

after https://github.com/rubyide/vscode-ruby#linters and installed all the jewels and edited settings.json like this.

{

  "ruby.rubocop.executePath": "/Users/ac/.rbenv/shims/",
  "ruby.rubocop.onSave": true,
  "ruby.lint": {
    "ruby": {
      "unicode": true //Runs ruby -wc -Ku
    },
    "reek": true,
    "rubocop": {
      "lint": true,
      "rails": true
    },
    "fasterer": true,
    "debride": {
      "rails": true //Add some rails call conversions.
    },
    "ruby-lint": true
  },
  "ruby.locate": {
    "include": "**/*.rb",
    "exclude": "{**/@(test|spec|tmp|.*),**/@(test|spec|tmp|.*)/**,**/*_spec.rb}"
  }

}

In vscode, code highlighting works fine.
* just note that you see installed extensions and warnings on the problems tab.

rubocop is working fine

Question

, vscode-ruby rubocop , , -, . , , prettier, ?

+4
2
+1

GitHub vscode-ruby-rubocop, :

{
    "editor.formatOnSave": true,
    "editor.formatOnSaveTimeout": 5000,
    "ruby.rubocop.executePath": "path/where/rubocop/is/located",
    "ruby.format": "rubocop",
}

, , , . VS ruby.rubocop.executePath ruby.rubocop.executePath , , , -, , - . - ( 2500) , , , 5000.

0

Source: https://habr.com/ru/post/1691533/


All Articles