Project

General

Profile

Bug #18534

rubocop not configured for Ruby 2.0, suggests using 2.3 safe navigation operator

Added by Dominic Cleal over 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

rubocop 0.43+ is recommending the safe navigation operator from Ruby 2.3 be used in a number of sources files when running on Ruby 2.3, e.g.

$ be rubocop lib/ws_proxy.rb
Inspecting 1 file
C

Offenses:

lib/ws_proxy.rb:33:5: C: Use safe navigation (&.) instead of checking if an object exists before calling the method.
    socket.close unless socket.nil?
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected

It should be configured for Ruby 2.0 compatibility.


Related issues

Related to Foreman - Bug #17796: Disable cop: Rails/HttpPositionalArgumentsClosed2016-12-20

Associated revisions

Revision d89db8e2 (diff)
Added by Dominic Cleal over 5 years ago

fixes #18534 - configure rubocop for Ruby 2.0 compatibility

History

#1 Updated by Dominic Cleal over 5 years ago

  • Related to Bug #17796: Disable cop: Rails/HttpPositionalArguments added

#2 Updated by The Foreman Bot over 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4293 added

#3 Updated by Dominic Cleal over 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal over 5 years ago

  • Legacy Backlogs Release (now unused) set to 209

Also available in: Atom PDF