diff --git a/.rubocop.yml b/.rubocop.yml index 27f0bdc..4a05e5c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -154,6 +154,10 @@ Style/SwapValues: # (new in 1.1) Enabled: true Style/HashConversion: # (new in 1.10) Enabled: true +Style/RedundantStringEscape: # (new in 1.7) + Enabled: true + Exclude: + - "test/lazylead/task/svn/grep_test.rb" Minitest/AssertInDelta: # (new in 0.10) Enabled: true Minitest/AssertionInLifecycleHook: # (new in 0.10) @@ -210,7 +214,7 @@ Performance/RedundantEqualityComparisonBlock: # (new in 1.10) Enabled: true Performance/RedundantSplitRegexpArgument: # (new in 1.10) Enabled: true -Gemspec/DateAssignment: # (new in 1.10) +Gemspec/DeprecatedAttributeAssignment: # (new in 1.10) Enabled: true Gemspec/RequireMFA: Enabled: false \ No newline at end of file diff --git a/lazylead.gemspec b/lazylead.gemspec index 14d48bd..bd89cb5 100644 --- a/lazylead.gemspec +++ b/lazylead.gemspec @@ -28,8 +28,6 @@ lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |s| - s.specification_version = 2 if s.respond_to? :specification_version= - s.rubygems_version = "2.2" s.required_ruby_version = ">=2.6.5" s.name = "lazylead" s.version = "0.0.0" @@ -93,7 +91,7 @@ tasks instead of solving technical problems." s.add_development_dependency "rdoc", "6.4.0" s.add_development_dependency "rubocop", "1.50.2" s.add_development_dependency "rubocop-minitest", "0.20.1" - s.add_development_dependency "rubocop-performance", "1.14.2" + s.add_development_dependency "rubocop-performance", "1.16.0" s.add_development_dependency "rubocop-rake", "0.6.0" s.add_development_dependency "rubocop-rspec", "2.11.1" s.add_development_dependency "ruby-prof", "1.4.3" diff --git a/lib/lazylead/cli/app.rb b/lib/lazylead/cli/app.rb index b85f130..d3b4ed1 100644 --- a/lib/lazylead/cli/app.rb +++ b/lib/lazylead/cli/app.rb @@ -59,7 +59,7 @@ def run(opts) def apply_vcs_migration(opts) @db = "#{File.expand_path(opts[:home])}/#{opts[:sqlite]}" vcs = "#{File.expand_path(opts[:home])}/#{opts[:vcs4sql]}" - @log.debug "Database: '#{@db.colorize(:light_blue)}', "\ + @log.debug "Database: '#{@db.colorize(:light_blue)}', " \ "sql migration dir: '#{vcs.colorize(:light_blue)}'" Vcs4sql::Sqlite::Migration.new(@db).upgrade vcs, opts[:testdata] @log.debug "Migration applied to '#{@db.colorize(:light_blue)}' from " \ diff --git a/lib/lazylead/exchange.rb b/lib/lazylead/exchange.rb index a60101d..ae71b4c 100644 --- a/lib/lazylead/exchange.rb +++ b/lib/lazylead/exchange.rb @@ -51,8 +51,8 @@ def initialize( # :opts :: the mail configuration like from, cc, subject, template. def send(opts) if opts.msg_to.empty? - @log.warn "ll-012: Email can't be sent to '#{opts.msg_to}," \ - " more: '#{opts}'" + @log.warn "ll-012: Email can't be sent to '#{opts.msg_to}, " \ + "more: '#{opts}'" else msg = make_msg opts cli.send_message msg diff --git a/lib/lazylead/postman.rb b/lib/lazylead/postman.rb index 18db779..753dfb5 100644 --- a/lib/lazylead/postman.rb +++ b/lib/lazylead/postman.rb @@ -54,8 +54,8 @@ def initialize(log = Log.new) # :opts :: the mail configuration like to, from, cc, subject, template. def send(opts) if opts.msg_to.empty? - @log.warn "ll-013: Email can't be sent to '#{opts.msg_to}," \ - " more: '#{opts}'" + @log.warn "ll-013: Email can't be sent to '#{opts.msg_to}, " \ + "more: '#{opts}'" else mail = make_email(opts) mail.deliver diff --git a/lib/lazylead/system/jira.rb b/lib/lazylead/system/jira.rb index 380e929..20430b0 100644 --- a/lib/lazylead/system/jira.rb +++ b/lib/lazylead/system/jira.rb @@ -47,8 +47,8 @@ def initialize(opts, salt = NoSalt.new, log = Log.new) @salt = salt @log = log @log.debug "Initiate a Jira client using following opts: " \ - "#{@opts.except 'password', :password} " \ - " and salt #{@salt.id} (found=#{@salt.specified?})" + "#{@opts.except 'password', :password} " \ + "and salt #{@salt.id} (found=#{@salt.specified?})" end # Find the jira issues by 'JQL' diff --git a/lib/lazylead/task/accuracy/accuracy.rb b/lib/lazylead/task/accuracy/accuracy.rb index 932d131..4f7dbb8 100644 --- a/lib/lazylead/task/accuracy/accuracy.rb +++ b/lib/lazylead/task/accuracy/accuracy.rb @@ -98,8 +98,8 @@ def comment comment = [ "Hi [~#{reporter}],", "", - "The triage accuracy is '{color:#{color}}#{@score}{color}'" \ - " (~{color:#{color}}#{@accuracy}%{color}), here are the reasons why:", + "The triage accuracy is '{color:#{color}}#{@score}{color}' " \ + "(~{color:#{color}}#{@accuracy}%{color}), here are the reasons why:", "|| Ticket requirement || Status || Field ||" ] @opts[:rules].each do |r| diff --git a/lib/lazylead/task/accuracy/stacktrace.rb b/lib/lazylead/task/accuracy/stacktrace.rb index b0e0905..12f5dd9 100644 --- a/lib/lazylead/task/accuracy/stacktrace.rb +++ b/lib/lazylead/task/accuracy/stacktrace.rb @@ -78,7 +78,7 @@ def pairs(words, text) words.each_with_index do |e, i| next unless e.start_with? text pair = snippets.last - pair << i if pair.size.zero? || pair.size == 1 + pair << i if pair.empty? || pair.size == 1 snippets[-1] = pair snippets << [] if pair.size == 2 end