rubocop / rubocop/ruby-style-guide

Conflict in a DSL style

Open
#558 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
16.5k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

# bad
expect(bowling.score).to eq 0
# good
expect(bowling.score).to eq(0)

But:

Omit parentheses around parameters for methods that are part of an internal DSL (e.g. Rake, Rails,RSpec)

IMO eq 0 looks better

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the issue's eq 0 and eq(0) examples with the referenced guidance for internal DSLs such as Rake, Rails, and RSpec. Decide whether the style guide needs a clarified exception or a consistent rule, then document the resolved guidance and verify that the conflicting examples no longer contradict it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.