Configuring Rubocop #6504
Replies: 6 comments 6 replies
-
This doesn't appear to work for me. I've tried both the bundle and non bundle version. I can run it in command line (without the --stdin). Does Zed have a console to see if there's any errors in executing the command? |
Beta Was this translation helpful? Give feedback.
-
the log trick helped - thanks, but how do I get rubocop to show/suggest ideas in the editor - without looking in the logs - like .map { |a| a.empty? } as |
Beta Was this translation helpful? Give feedback.
-
I had trouble making this work too, so I share here as it might help someone too.
|
Beta Was this translation helpful? Give feedback.
-
Adding the |
Beta Was this translation helpful? Give feedback.
-
As a small update and reflecting previous comments and suggestions, on Zed 0.14.0.5 I've been successfully using this in {
"languages": {
"Ruby": {
"tab_size": 2,
"hard_tabs": false,
"format_on_save": "on",
"language_servers": ["ruby-lsp", "!solargraph"],
"formatter": {
"external": {
"command": "bundle",
"arguments": [
"exec",
"rubocop",
"--server",
"--fail-level",
"error",
"--autocorrect",
"--stdin",
"corrected.rb",
"--stderr"
]
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
I'm still running into this issue. I've tried changing the command but none of the suggestions have worked for me. Here's what I have in my "languages": {
"Ruby": {
"language_servers": [
"tailwindcss-language-server",
"ruby-lsp",
"!solargraph"
],
"format_on_save": "on",
"formatter": {
"external": {
"command": "bundle",
"arguments": [
"exec",
"rubocop",
"--server",
"--fail-level",
"error",
"--autocorrect",
"--stdin",
"corrected.rb",
"--stderr"
]
}
}
}, I might be missing something obvious. Really appreciate any suggestions! And I love Zed. |
Beta Was this translation helpful? Give feedback.
-
If you are looking to lint your Ruby code with Rubocop, you can configure it using one of the following settings snippets:
with bundler
without bundler
Tip originally posted here by Kucho.
Beta Was this translation helpful? Give feedback.
All reactions