python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Rubocop: RuboCop found unknown Ruby version 3.1 in `.ruby-version`
I recently upgraded ruby version from 2.7.5 to 3.1.1 and when I try to run rubocop I get error Error: RuboCop found unknown Ruby version 3.1 in .ruby-version. Supported versions: 2.3, 2.4, 2.5, 2.6, 2...
user18646557
Votes: 0
Answers: 1
Reduce AbcSize metric when sanitizing params hash
I have a simple method in my Purchases controller that tweaks user form input from the params hash, prior to applying strong parameters.
def sanitize_params
params[:purchase][:invoice] = nil if para...
Dan SimBed
Votes: 0
Answers: 2
How to implement a custom Rubocop rule for checking git branch naming convention?
For example, I need to check the correctness of git branch naming - it should contain ticket ID similarly to this:
module Rails
class GitBranchName < RuboCop::Cop::Cop
MSG = "Use correct...
Oleksandr Bratashov
Votes: 0
Answers: 2
Rubocop Lint/DuplicateMethods -- which duplicate should I keep?
Rubocop reports:
app/models/transformer.rb:8:3: W: Lint/DuplicateMethods: Method Painter#last_color
is defined at both app/models/painter.rb:2 and app/models/painter.rb:5.
Painter class looks like...
David Hempy
Votes: 0
Answers: 2