Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop update to 1.9.1 #103

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix rubocop errors
  • Loading branch information
elfranne committed Feb 3, 2021
commit 19797f7116290201346bdc1c0c8f9e40c3dbc357
80 changes: 79 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Metrics/MethodLength:
Max: 200

Expand Down Expand Up @@ -143,4 +142,83 @@ Style/SlicingWithRange:
Style/StringConcatenation:
Enabled: false

Layout/SpaceBeforeBrackets:
Enabled: true

Lint/AmbiguousAssignment:
Enabled: true

Lint/DeprecatedConstants:
Enabled: true

Lint/DuplicateBranch:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Lint/EmptyBlock:
Enabled: true

Lint/EmptyClass:
Enabled: true

Lint/LambdaWithoutLiteralBlock:
Enabled: true

Lint/NoReturnInBeginEndBlocks:
Enabled: true

Lint/NumberedParameterAssignment:
Enabled: true

Lint/OrAssignmentToConstant:
Enabled: true

Lint/RedundantDirGlobSort:
Enabled: true

Lint/SymbolConversion:
Enabled: true

Lint/ToEnumArguments:
Enabled: true

Lint/TripleQuotes:
Enabled: true

Lint/UnexpectedBlockArity:
Enabled: true

Lint/UnmodifiedReduceAccumulator:
Enabled: true

Style/ArgumentsForwarding:
Enabled: true

Style/CollectionCompact:
Enabled: true

Style/DocumentDynamicEvalDefinition:
Enabled: true

Style/EndlessMethod:
Enabled: true

Style/HashExcept:
Enabled: true

Style/IfWithBooleanLiteralBranches:
Enabled: true

Style/NegatedIfElseCondition:
Enabled: true

Style/NilLambda:
Enabled: true

Style/RedundantArgument:
Enabled: true

Style/SwapValues:
Enabled: true
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ ENV['TZ'] = 'CET'
args = %i[spec make_bin_executable yard rubocop check_binstubs]

YARD::Rake::YardocTask.new do |t|
OTHER_PATHS = %w[].freeze
t.files = ['lib/**/*.rb', 'bin/**/*.rb', OTHER_PATHS]
t.files = ['lib/**/*.rb', 'bin/**/*.rb']
t.options = %w[--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md]
end

Expand Down
6 changes: 3 additions & 3 deletions bin/check-ssl-cert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ def validate_opts
elsif config[:pem]
unknown 'No such cert' unless File.exist? config[:pem]
elsif config[:pkcs12]
if !config[:pass]
unknown 'No pass phrase specified for PKCS#12 certificate'
else
if config[:pass]
unknown 'No such cert' unless File.exist? config[:pkcs12]
else
unknown 'No pass phrase specified for PKCS#12 certificate'
end
end
config[:servername] = config[:host] unless config[:servername]
Expand Down
4 changes: 2 additions & 2 deletions bin/check-ssl-root-issuer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CheckSSLRootIssuer < Sensu::Plugin::Check::CLI
required: false

def cert_name_format
# Note: because format argument is pre-validated by mixin 'in' logic eval is safe to use
# NOTE: because format argument is pre-validated by mixin 'in' logic eval is safe to use
eval "OpenSSL::X509::Name::#{config[:format]}" # rubocop:disable Security/Eval, Style/EvalWithLocation
end

Expand Down Expand Up @@ -100,7 +100,7 @@ def find_root_cert(uri)
end
verify_ok
}
http.start {}
http.start
root_cert
end

Expand Down