ruby-style-guide icon indicating copy to clipboard operation
ruby-style-guide copied to clipboard

A community-driven Ruby coding style guide

Results 75 ruby-style-guide issues
Sort by recently updated
recently updated
newest added

I have found the Ruby Style Guide while I was trying to find out which case conventions the Ruby community uses for methods. Fortunately there's a Ruby Style Guide (thanks!)...

In https://github.com/shopify/ruby-style-guide#syntax we say: > omit parentheses when the invocation is single-line and the method [...] is a class method call with implicit receiver. But currently this isn't enforced by...

The text in [String Concatenation](https://github.com/rubocop/ruby-style-guide#concat-strings) is not rendered correctly because `+` means [literal text](https://docs.asciidoctor.org/asciidoc/latest/text/literal-monospace/) without formatting. It can be fixed by adding the passthrough macros. Additionally, I noticed that this...

For https://github.com/rubocop/rubocop/pull/12427 which is the RuboCop implementation of this. I'll just copy the examples over: ```rb def some_method(*args, **kwargs) super(*args, **kwargs) end # good - implicitly passing all arguments def...

When using ternary with array push operator, the result may surprise you depending on your knowledge of operator precedence. ```ruby array = [] # bad array 1 # array =...

I proposed PR https://github.com/rubocop/rubocop/pull/13352 to add a new `Lint/NoRescueErrorMessageChecking` cop that discourages rescue error matching. We built a custom cop at my company and thought it might be useful to...

This PR adds empty lines after guard clauses in the "Nested Conditionals" section. This helps maintain best practices even when explaining other cases.

It is painful to see many `&.` calls in a chain. If I want to have at most 2 safe navigation calls in a row, for example, then: ```ruby #...

Adds a rule to complement RuboCop PR https://github.com/rubocop/rubocop/pull/14288. This rule suggests to use [Enumerable querying methods](https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Methods+for+Querying) rather than expressions with `#count` to check if collections meet some criteria.