Skip to content

Commit

Permalink
Mandatory rubocop commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mhenrixon committed Mar 21, 2020
1 parent ecdfd37 commit e9bd848
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
16 changes: 13 additions & 3 deletions .rubocop.yml
Expand Up @@ -30,7 +30,7 @@ Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*"

Lint/HandleExceptions:
Lint/SuppressedException:
Enabled: true

Lint/UselessAssignment:
Expand All @@ -42,7 +42,7 @@ Metrics/AbcSize:
Metrics/CyclomaticComplexity:
Max: 7

Metrics/LineLength:
Layout/LineLength:
Max: 120

Metrics/MethodLength:
Expand All @@ -54,6 +54,7 @@ Metrics/BlockLength:
- "**/spec/**/*.rb"
- "**/*.rake"
- "Rakefile"
- "Gemfile"
- "*.gemspec"

Metrics/PerceivedComplexity:
Expand All @@ -73,7 +74,7 @@ Naming/FileName:
Naming/RescuedExceptionsVariableName:
PreferredName: ex

Naming/UncommunicativeMethodParamName:
Naming/MethodParameterName:
AllowedNames:
- ex

Expand Down Expand Up @@ -134,6 +135,15 @@ Style/FrozenStringLiteralComment:
Style/GlobalVars:
Enabled: true

Style/HashEachMethods:
Enabled: false

Style/HashTransformKeys:
Enabled: false

Style/HashTransformValues:
Enabled: false

Style/ModuleFunction:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -32,7 +32,7 @@ platforms :mri do
gem "rubocop-performance"
gem "rubocop-rspec"
gem "ruby-prof"
gem "simplecov", '< 0.18'
gem "simplecov", "< 0.18"
gem "simplecov-material"
gem "simplecov-oj"
gem "stackprof"
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq_unique_jobs/version_check.rb
Expand Up @@ -7,7 +7,7 @@ module SidekiqUniqueJobs
# @author Mikael Henriksson <mikael@zoolutions.se>
#
class VersionCheck
PATTERN = /(?<operator1>[<>=]+)?\s?(?<version1>(\d+.?)+)(\s+&&\s+)?(?<operator2>[<>=]+)?\s?(?<version2>(\d+.?)+)?/m.freeze # rubocop:disable Metrics/LineLength
PATTERN = /(?<operator1>[<>=]+)?\s?(?<version1>(\d+.?)+)(\s+&&\s+)?(?<operator2>[<>=]+)?\s?(?<version2>(\d+.?)+)?/m.freeze # rubocop:disable Layout/LineLength

#
# Checks if a version is consrtaint is satisfied
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq_unique_jobs/web.rb
Expand Up @@ -2,7 +2,7 @@

begin
require "sidekiq/web"
rescue LoadError # rubocop:disable Lint/HandleExceptions
rescue LoadError # rubocop:disable Lint/SuppressedException
# client-only usage
end

Expand Down
Expand Up @@ -4,8 +4,8 @@
RSpec.describe SidekiqUniqueJobs::Lock::WhileExecuting, redis: :redis do
include SidekiqHelpers

let(:process_one) { described_class.new(item_one, callback_one) }
let(:process_two) { described_class.new(item_two, callback_two) }
let(:process_one) { described_class.new(item_one, callback_one) }
let(:process_two) { described_class.new(item_two, callback_two) }
let(:strategy_one) { nil }
let(:strategy_two) { nil }

Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Expand Up @@ -27,8 +27,8 @@

require "sidekiq/redis_connection"

Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].each { |f| require f }
Dir[File.join(File.dirname(__FILE__), "..", "examples", "**", "*.rb")].each { |f| require f }
Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].sort.each { |f| require f }
Dir[File.join(File.dirname(__FILE__), "..", "examples", "**", "*.rb")].sort.each { |f| require f }

RSpec.configure do |config|
config.define_derived_metadata do |meta|
Expand Down
6 changes: 4 additions & 2 deletions spec/unit/sidekiq_unique_jobs/cli_spec.rb
Expand Up @@ -106,8 +106,10 @@ def exec(*cmds)
let(:console_class) { defined?(Pry) ? Pry : IRB }

before do
require "pry"
rescue NameError, LoadError, NoMethodError # rubocop:disable Lint/SuppressedException, Lint/ShadowedException
begin
require "pry"
rescue NameError, LoadError, NoMethodError # rubocop:disable Lint/ShadowedException, Lint/SuppressedException
end
end

it_behaves_like "start console"
Expand Down
6 changes: 0 additions & 6 deletions spec/unit/sidekiq_unique_jobs/on_conflict/strategy_spec.rb
Expand Up @@ -21,10 +21,4 @@
expect { call }.to raise_error(NotImplementedError, "needs to be implemented in child class")
end
end

describe "#replace?" do
subject { strategy.replace? }

it { is_expected.to eq(false) }
end
end
Expand Up @@ -32,7 +32,7 @@ def initialize(worker_class)
it { is_expected.to eq(MyUniqueJob) }
end

context "when worker_class is MyUniqueJob" do
context "when worker_class is UntilExecutedJob" do
let(:worker_class) { "UntilExecutedJob" }

it { is_expected.to eq(UntilExecutedJob) }
Expand Down

0 comments on commit e9bd848

Please sign in to comment.