Skip to content

Commit

Permalink
update rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver authored and ehelms committed Jul 12, 2023
1 parent 88f75de commit c34aec2
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 15 deletions.
13 changes: 6 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-minitest
- rubocop-performance
- rubocop-rake

AllCops:
TargetRubyVersion: 2.5

Rails:
Enabled: false

# Don't enforce documentation
Style/Documentation:
Enabled: false
Expand Down Expand Up @@ -35,7 +37,7 @@ Naming/FileName:
Naming/HeredocDelimiterNaming:
Enabled: false

Style/TrailingCommaInLiteral:
Style/TrailingCommaInArrayLiteral:
Enabled: false

Style/TrailingCommaInArguments:
Expand All @@ -59,9 +61,6 @@ Style/ClassAndModuleChildren:
Style/GuardClause:
Enabled: false

Style/BracesAroundHashParameters:
Enabled: false

Style/SignalException:
Enabled: false

Expand Down
141 changes: 136 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,145 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-10-20 13:40:01 +0200 using RuboCop version 0.52.1.
# `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.28.2.
# 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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 33
# Cop supports --auto-correct.
# This cop supports safe auto-correction (--auto-correct).
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/smart_proxy_dynflow/callback.rb'
- 'lib/smart_proxy_dynflow/continuous_output.rb'
- 'lib/smart_proxy_dynflow/core.rb'
- 'lib/smart_proxy_dynflow/process_manager.rb'
- 'lib/smart_proxy_dynflow/runner/base.rb'
- 'lib/smart_proxy_dynflow/runner/command.rb'
- 'lib/smart_proxy_dynflow/runner/dispatcher.rb'
- 'lib/smart_proxy_dynflow/settings_loader.rb'
- 'test/test_helper.rb'

# This cop supports safe auto-correction (--auto-correct).
Layout/EmptyLineAfterMagicComment:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
# AllowedMethods: alias_method, public, protected, private
Layout/EmptyLinesAroundAttributeAccessor:
Exclude:
- 'lib/smart_proxy_dynflow/runner/dispatcher.rb'
- 'lib/smart_proxy_dynflow/runner/update.rb'
- 'lib/smart_proxy_dynflow/task_launcher/abstract.rb'

# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'test/io_buffer_test.rb'

Lint/MissingSuper:
Exclude:
- 'lib/smart_proxy_dynflow/log.rb'
- 'lib/smart_proxy_dynflow/runner/dispatcher.rb'
- 'lib/smart_proxy_dynflow/ticker.rb'

# This cop supports safe auto-correction (--auto-correct).
Minitest/AssertEmpty:
Exclude:
- 'test/io_buffer_test.rb'

# This cop supports safe auto-correction (--auto-correct).
Minitest/AssertEqual:
Exclude:
- 'test/helpers_test.rb'

# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/smart_proxy_dynflow/core.rb'
- 'lib/smart_proxy_dynflow/otp_manager.rb'

# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/smart_proxy_dynflow/runner/process_manager_command.rb'

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: PreferredName.
Naming/RescuedExceptionsVariableName:
Exclude:
- 'lib/smart_proxy_dynflow/runner/dispatcher.rb'

# This cop supports safe auto-correction (--auto-correct).
Style/ExpandPathArguments:
Exclude:
- 'smart_proxy_dynflow.gemspec'

# This cop supports safe auto-correction (--auto-correct).
Style/ExplicitBlockArgument:
Exclude:
- 'lib/smart_proxy_dynflow/middleware/keep_current_request_id.rb'

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: when_needed, always, never
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
Style/GlobalStdStream:
Exclude:
- 'lib/smart_proxy_dynflow/runner/base.rb'

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/smart_proxy_dynflow/api.rb'

# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/smart_proxy_dynflow/action/single_runner_batch.rb'
- 'lib/smart_proxy_dynflow/runner/base.rb'
- 'lib/smart_proxy_dynflow/runner/dispatcher.rb'
- 'lib/smart_proxy_dynflow/runner/update.rb'

# This cop supports safe auto-correction (--auto-correct).
Style/RedundantAssignment:
Exclude:
- 'lib/smart_proxy_dynflow/core.rb'

# This cop supports safe auto-correction (--auto-correct).
Style/RedundantFileExtensionInRequire:
Exclude:
- 'test/api_test.rb'

# This cop supports safe auto-correction (--auto-correct).
Style/RedundantFreeze:
Exclude:
- 'lib/smart_proxy_dynflow/log.rb'
- 'lib/smart_proxy_dynflow/version.rb'

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'lib/smart_proxy_dynflow/otp_manager.rb'

# This cop supports unsafe auto-correction (--auto-correct-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'test/helpers_test.rb'

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 197
8 changes: 7 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ source 'https://rubygems.org'

gemspec :name => 'smart_proxy_dynflow'

group :rubocop do
gem 'rubocop', '~> 1.28.0'
gem 'rubocop-minitest'
gem 'rubocop-performance'
gem 'rubocop-rake'
end

group :development do
gem 'pry'
end
Expand All @@ -12,7 +19,6 @@ group :test do
gem 'public_suffix'
gem 'rack-test'
gem 'rake'
gem 'rubocop', '~> 0.52.1'
gem 'smart_proxy', :git => "https://github.com/theforeman/smart-proxy", :branch => "develop"
gem 'webmock'
end
Expand Down
4 changes: 2 additions & 2 deletions lib/smart_proxy_dynflow/io_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def close
def read_available!
data = ''
loop { data += @io.read_nonblock(4096) }
rescue IO::WaitReadable # rubocop:disable Lint/HandleExceptions
rescue IO::WaitReadable # rubocop:disable Lint/SuppressedException
rescue EOFError
close
ensure
Expand All @@ -88,7 +88,7 @@ def write_available!
n = @io.write_nonblock(@buffer)
@buffer = @buffer[n..-1]
end
rescue IO::WaitWritable # rubocop:disable Lint/HandleExceptions
rescue IO::WaitWritable # rubocop:disable Lint/SuppressedException
rescue EOFError
close
end
Expand Down

0 comments on commit c34aec2

Please sign in to comment.