-
Notifications
You must be signed in to change notification settings - Fork 71
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
Rubocop too overzealous? #14
Comments
Also here: |
One possible solution is to use --only-guide-cops as documented in rubocop/rubocop#1454 |
@jyaworski that seems like a very good idea, and is probably very much less… opinionated.! |
@jyaworski can you add pr that changes our config to that? |
Can I suggest using .rubocop.yml from garethr/puppet-module-skeleton as a base? https://github.com/garethr/puppet-module-skeleton/blob/master/skeleton/.rubocop.yml |
there are a couple of those i don't entirely agree with… such as: Style/RegexpLiteral:
Enabled: false that's literally the reason i started this whole thing ;) |
One solution is to add --fail-level and set it to a sane default; say 'E'. Maybe add a parameter to .sync.yml to toggle it per-project if you want? How does that sound?
|
OK so my initial thoughts on trying to get my spec tests reformatted to meet the current requirements is that I will still be reformatting perfectly working code in about 2 weeks from now, and this is only one project! I have literally spent an entire evening formatting text and I am only about 50% done. Rubocops autocorrect is a disaster, so that did not even help. We need a more sane config file in order for any module to make rubocop a viable option or force it to exit 0 as per @jyaworski previous comment. |
Agreed. |
I don't think long lines or
We can certainly tone them down a bit but just throwing out parts from the style guide we find inconvenient is not something I'm willing to support. Theres should be good reasons and arguments for the exceptions we're going to make. |
@daenney i also agree with that, however, rubocop's default auto_correct behaviour is awful… |
Then don't autocorrect/use the fixers, just let it complain about it and fix it yourself 😄. There's a few we can disable but from the presented use cases I only find nested functions potentially troublesome. But nested functions are also bad. |
fixing thousands of lines code isn't really my idea of fun :P |
It's not thousands of lines, it's one module at a time and not all modules, far from all, have native types and providers. And new code can start out directly by adhering to this. There's also no need to go full on zealot on it and fix everything now now now. |
when i say thousands of lines of code, i specifically mean rspec tests. |
Definitely agree with @daenney on |
after merging #21 i think we've got some better fit… |
now, if only we had some kind of trigger that would run msync update for us… |
I just resynced voxpupuli/puppet-rundeck#139 and I'm getting different errors. Still looking into them. |
All right. Lots of refactoring later and I'm back to a smaller number of rubocop errors. @daenney and @danzilio: I'm not super well-versed in Ruby, so maybe I spoke out of naivete with the and/&& thing. Long lines I understand the frustration as well. However, I share @igalic's general frustration surrounding rspec tests; that's where all of that PR I mentioned is failing, and some of them are non-trivial to fix. Do we really want to lint spec files in that case? |
That is a good question. I'm not convinced the spec tests have to adhere to all the Rubocop madness. It might be worth only loading rubocop-rspec for the spec/ directory and a few basic other cops. |
Personally I think it makes the spec tests harder to read: https://github.com/puppet-community/puppet-stash/pull/99/files |
All right; I've turned off a few cops in #24. |
@mkrakowitzer i can't even tell the difference anymore |
We need an exclusion for these kinds of errors. I don't agree with rubocop
|
Well, just because one person doesn't agree is not a good enough reason to exclude. Why do you disagree and perhaps share a few screenshots of code that is more legible in your case than what rubocop recommends? |
i'm pretty and sure i've excluded those ;) |
@daenney this is the default way of defining puppet functions. example: logicminds/puppet-extlib@fc46c63#diff-e24a4c8f84f47be4ba90e4572ed66e18R11 Every puppet function in puppet core is defined this way. |
I just linked from a PR where it's complaining about module comments. Definitely not something worth failing on. |
@jyaworski any idea what needs to change to make it pass? |
Hello:
I've been working on the puppet-rundeck modulesync changes at voxpupuli/puppet-rundeck#134
It looks like it's failing on rubocop, but a lot of it is very benign.
etc
One of the main things I'm running into is:
rubocop/rubocop#1238
Can we tone down Rubocop's aggression?
The text was updated successfully, but these errors were encountered: