rubocop / rubocop/ruby-style-guide

Using the safe navigation operator with other operators?

Open
#705 2 comments 0 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

Recently, I came across this:

do_something if value1 &.!= value2

Which was equal parts very cool and startling.

So I wanted to get community feedback on whether or not it was too obscure to be good style. We can add our findings to the style guide, since there is no guidance on it yet

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 reviewing the safe navigation operator example in the issue and the existing Ruby style guide. Gather community feedback on whether this syntax is too obscure for good style, then document the agreed guidance in the style guide.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.