ruby-style-guide
ruby-style-guide copied to clipboard
A community-driven Ruby coding style guide
All is about to use empty line after `return` or not? First example from https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods ``` def some_method data = initialize(options) data.manipulate! data.result end ``` and second example from here...
Regarding the rules about using nested conditionals for flow of control found [here](https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals), I wanted to raise attention to these two particular fragments of the bad vs good code samples:...
Although the case equality operator === is mentioned, of the two methods of class checking demonstrated here: ``` "this string".is_a? String # => true "this string".is_a? Object # => true...
Maybe a question more than an issue: I've gravitated toward using `if not` in certain circumstances, and I've figured out why: In situations where I expect the condition to be...
I have a dilemma regarding styling this peace of code. Should `end` on the last line be aligned with the start of the initial line or with the `.map` call?...
I came to check the guide for suggestions but didn't see anything for this. ``` ruby # clear but can we make it more compact? people = [ { :name...
I didn't see this defined in the guide, sorry if I'm just not seeing it. The guide should define a best practice for long method signatures, like: ``` def do_something(os...
Why are these forms favoured? They're harder to read than the original syntax and easily lead to errors with commas. I've personally lost hours chasing non-existent bugs thanks to this...
According to [research](https://github.com/rubocop/rubocop/issues/8827#issuecomment-1159313300): annotated (`%s`): 57497 files inspected, 5785 offenses detected template (`%{name}`): 57497 files inspected, 1279 offenses detected unannotated (`%s`) 57497 files inspected, 6424 offenses detected the `%{name}` is...