New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option for --force-exclusion to ruby-rubocop checker? #1348
Comments
Looking at the discussion in rubocop/rubocop#893 (comment), I get that If you don't want to check a specific file, why run Flycheck on it then? Do you have a specific use case that requires this option? |
Thanks for the reply, @fmdkdd . My use case (which I believe is common) is to be able to have the rubocop checker globally enabled in my Rails-based project without being swamped with error highlighting when I open the |
Maybe I'm missing something, but this sounds odd. Why do we need that option to achieve this? Isn't it simpler to just ask Flycheck not to lint these files, using whichever predicate you'd use to turn that option on? IOW, what does it gain us to run rubocop on some file Maybe it'd help if you can show how you'd set this hypothetical new variable :) Let's assume we add |
Oh, wait, I think I understand now. |
Yes, I think the flag is necessary because when the rubocop the executable is being fed an explicit list of filenames (as is often the case with linters) it by default overrides any exclusions specified in the |
@cpitclaudel I see that the flag is mostly harmless (because if the user is the one editing the rubocop config file, they won't be surprised that Flycheck isn't checking it). The flag was added in 2014, so I think it should be fine to set as default, since it's a better default experience. |
Yeah, this should just be added after |
Add --force-exclusion flag to rubocop command
Thanks all for the quick and thoughtful response to this! |
Hi, I'm banging my head against walls — for the first time in my quite substantial Spacemacs usage — so I will really appreciate help here. I'm trying to disable Rubocop by default — and enable it only when its config file is present in a project. So I wonder if this actually worked, and if it works still, and if anyone on Spacemacs can confirm that. These are my other issues on the subject: Thanks a lot in advance. |
As discussed in rubocop/rubocop#893 (comment) when running rubocop from a linter such as flycheck, it is impossible to ignore a particular file or directory from the usual rubocop.yml config file. To address this, the rubocop project added the
--force-exclusion
command line option (rubocop/rubocop#922). Would it be possible to add--force-exclusion
to flycheck's default invocation of rubocop, or to add a flycheck var to enable that option?Thanks so much for your work on this great tool!
The text was updated successfully, but these errors were encountered: