-
Notifications
You must be signed in to change notification settings - Fork 286
In editor a linting (rubocop) error is show that doesn't appear in console #698
Comments
I have the same problem. This commit seems to break rubocop linter. rubocop's Include and Exclude paths are based on current working directory. The default config of Rails/EnumHash includes Rails/EnumHash:
Description: 'Prefer hash syntax over array syntax when defining enums.'
StyleGuide: 'https://rails.rubystyle.guide#enums'
Enabled: true
VersionAdded: '2.3'
Include:
- app/models/**/*.rb |
Using solargraph is a workaround. Install solargraph 0.40.0. Configure vscode like this.
And place
|
Another workaround is to install version 0.27.0 of vscode-ruby instead of latest 0.28.1 which causes the issue outlined above. |
I confirm that the issue doesn't appear on 0.27.0. |
And I have this issue to appear only for rules that have exclusion for some file. If a file is excluded from a rule, then I see a warning for this rule in VSCode but don't see it when run rubocop from the console. |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
it's active |
It's very annoying of course. How can I configure vscode to behave exactly like in console using .rubocop.yml? |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
It's active 😊 |
Any updates? :-) |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
It's active. Stupid bot. |
Anything we can do to help fix/release this? 🙂 |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
Development for this project is too slow to use this bot. No new releases for half a year. |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
Naaaah you stupid bot. It's active! |
I think the problem is not in the bot :-) |
I know. Seriously I'd be open to being a bit more involved in the project to help it move forward. Ruby is far from a dying language and it's killing me that this extension doesn't get updated more often. Dear maintainer(s), would you consider bringing more people to the table? |
Yes Just know that the support load from this extension is high. You have to be able to troubleshoot peoples environments to fix issues. The permutations of Rubies, version managers, Gemfiles, expectations, etc is tough. Plus, keeping up with the pace of VSCodes development for free, in your spare time, is pretty rough. People complain about the debugger a lot and I can count on one hand the number of PRs I get on it. Just being honest here. I don’t look at this much anymore due to A) not coding much anymore and B) burnout |
Thanks for the disclaimer @wingrunr21. I appreciate the work you've done to make this extension. I think the more people on board the lighter each individual contribution can be. But I'm not naive, I know people want things to be done for them, not by them, most of the time. I haven't had much spare time lately, working on two jobs + 1 baby 😅, but if I can be of help, I'd like to. Given how many companies use Ruby as their main language and how many developers are using VSCode today, did any of them approached you to propose some help? Maybe I could try to reach out to some of them if it's not the case 🙂 if it's something that you would consider of course. |
I have not had anyone approach me, no. I will set aside time this weekend to review open (and probably closed by the bot) PRs and get things up to date. I'll also be adding a call for maintainers to the README. Perhaps with Hacktoberfest coming up we can clean up the issues list and get some folks to contribute. |
That'd be awesome 🙂 Once again, thanks for the time you're putting in. |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
🤖🔫 |
This issue has not had activity for 30 days. It will be automatically closed in 7 days. |
active |
I might be able to add some details, maybe this helps someone more familiar with the inner workings of this extension to know what to look for: If you've got something like this in your .rubocop.yml Metrics/BlockLength:
Exclude:
- lib/tasks/**/*.rake long Blocks in rake tasks will be highlighted in vs code, while rubocop run from command line will tell you everything is fine. If you changed your configuration to one of the below, exclusions will work fine in vs code, no more false positives: Metrics/BlockLength:
Exclude:
- lib/tasks/**/* or Metrics/BlockLength:
Exclude:
- lib/tasks/**/*.rake* or Metrics/BlockLength:
Exclude:
- lib/tasks/**/*.rake' => It seems like for some reason rubocop is taking the file name it is given by the extension too literally, including the quotes around the file name when matching exclusions. Update: |
This issue has not had activity for 30 days. It will be automatically closed in 30 days. |
It's still active. Maybe it will be fixed in the next release because potential PR was merged. |
This issue has not had activity for 30 days. It will be automatically closed in 30 days. |
🤖 |
This issue has not had activity for 30 days. It will be automatically closed in 30 days. |
🤖 |
Your environment
vscode-ruby
version: 0.28.1useLanguageServer
is true in your configuration?): YesExpected behavior
I expect that I don't see any rubocop error in the editor I there is no errors when I run rubocop from the console.
Actual behavior
I see the next error in the editor:
But when I run rubocop in console for this file I don't see any error (and shouldn't):
❯ rubocop app/models/article.rb Inspecting 1 file . 1 file inspected, no offenses detected
If I try to run rubocop as language server do I don't have errors too:
If I remove this
# rubocop:disable Rails/EnumHash
comment then the error in the editor disappear, but I will have an error when I run rubocop from the console:I'm not sure when this error appears after rubocop update or after the last vscode-ruby update.
I will be glad to help with any debugging but right now I don't know where to go.
The text was updated successfully, but these errors were encountered: