From 547a7c62868a059a1de322eeec44f7d1815077d9 Mon Sep 17 00:00:00 2001 From: Robert Cheramy Date: Tue, 16 Jan 2024 12:06:09 +0100 Subject: [PATCH] Correction of new RuboCop offenses (RuboCop version 1.60.0) - use ... for arguments formating - Don't use redundant parentheses --- .rubocop_todo.yml | 2 +- lib/oxidized/model/model.rb | 4 ++-- lib/oxidized/nodes.rb | 4 ++-- lib/oxidized/output/git.rb | 4 ++-- lib/oxidized/output/gitcrypt.rb | 4 ++-- lib/oxidized/source/source.rb | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index fda39bb80..9798a59aa 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-11-27 13:35:47 UTC using RuboCop version 1.57.2. +# on 2024-01-16 10:57:24 UTC using RuboCop version 1.60.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb index 1ebd03e1e..0ff0d012f 100644 --- a/lib/oxidized/model/model.rb +++ b/lib/oxidized/model/model.rb @@ -143,8 +143,8 @@ def send(data) @input.send data end - def expect(regex, &block) - self.class.expect regex, &block + def expect(...) + self.class.expect(...) end def cfg diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index d572d9621..09fae5ad3 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -129,8 +129,8 @@ def initialize(opts = {}) end end - def with_lock(&block) - @mutex.synchronize(&block) + def with_lock(...) + @mutex.synchronize(...) end def find_index(node) diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index a388b8d61..592b1ebac 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -36,8 +36,8 @@ def setup def store(file, outputs, opt = {}) @msg = opt[:msg] - @user = (opt[:user] || @cfg.user) - @email = (opt[:email] || @cfg.email) + @user = opt[:user] || @cfg.user + @email = opt[:email] || @cfg.email @opt = opt @commitref = nil repo = @cfg.repo diff --git a/lib/oxidized/output/gitcrypt.rb b/lib/oxidized/output/gitcrypt.rb index 529a80d75..a309fd68d 100644 --- a/lib/oxidized/output/gitcrypt.rb +++ b/lib/oxidized/output/gitcrypt.rb @@ -64,8 +64,8 @@ def unlock(repo) def store(file, outputs, opt = {}) @msg = opt[:msg] - @user = (opt[:user] || @cfg.user) - @email = (opt[:email] || @cfg.email) + @user = opt[:user] || @cfg.user + @email = opt[:email] || @cfg.email @opt = opt @commitref = nil repo = @cfg.repo diff --git a/lib/oxidized/source/source.rb b/lib/oxidized/source/source.rb index e5e220f8b..99780173a 100644 --- a/lib/oxidized/source/source.rb +++ b/lib/oxidized/source/source.rb @@ -3,8 +3,8 @@ class Source class NoConfig < OxidizedError; end def initialize - @model_map = (Oxidized.config.model_map || {}) - @group_map = (Oxidized.config.group_map || {}) + @model_map = Oxidized.config.model_map || {} + @group_map = Oxidized.config.group_map || {} end def map_model(model)