Routine rubocop fixes (#9015)

* rubocop -a

* Routine rubocop fixes
This commit is contained in:
rhymes 2020-06-30 22:38:39 +02:00 committed by GitHub
parent 9b6ab40572
commit 5eaeb584b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 14 deletions

View file

@ -122,6 +122,10 @@ Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*"
Lint/ConstantResolution:
Description: 'Check that constants are fully qualified with `::`.'
Enabled: false
Lint/DeprecatedOpenSSLConstant:
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
Enabled: true
@ -318,10 +322,12 @@ Style/Next:
StyleGuide: '#no-nested-conditionals'
Enabled: false
Style/RegexpLiteral:
Description: 'Use / or %r around regular expressions.'
StyleGuide: '#percent-r'
Enabled: false
Style/RedundantFetchBlock:
Description: >-
Use `fetch(key, value)` instead of `fetch(key) { value }`
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
Enabled: true
Style/RedundantRegexpCharacterClass:
Description: 'Checks for unnecessary single-element Regexp character classes.'
@ -331,6 +337,11 @@ Style/RedundantRegexpEscape:
Description: 'Checks for redundant escapes in Regexps.'
Enabled: true
Style/RegexpLiteral:
Description: 'Use / or %r around regular expressions.'
StyleGuide: '#percent-r'
Enabled: false
Style/ReturnNil:
Description: 'Use return instead of return nil.'
Enabled: true

View file

@ -6,13 +6,13 @@ require:
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-06-15 17:38:54 +0200 using RuboCop version 0.85.1.
# on 2020-06-30 07:14:27 UTC using RuboCop version 0.86.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
# versions of RuboCop, may require this file to be generated again.
# Offense count: 277
# Offense count: 279
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 62
@ -23,12 +23,16 @@ Metrics/AbcSize:
Metrics/BlockLength:
Max: 61
# Offense count: 9
# Offense count: 3
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 15
# Offense count: 8
Performance/OpenStruct:
Exclude:
- 'app/models/article.rb'
- 'app/models/organization.rb'
- 'app/services/aws/fake_client.rb'
- 'app/services/notifications/reactions/send.rb'
- 'spec/models/github_repo_spec.rb'
- 'spec/requests/github_repos_spec.rb'
@ -40,7 +44,7 @@ RSpec/ExampleLength:
- 'spec/models/comment_spec.rb'
- 'spec/requests/display_ad_events_spec.rb'
# Offense count: 881
# Offense count: 907
RSpec/MultipleExpectations:
Max: 12
@ -82,7 +86,7 @@ Rails/UniqueValidationWithoutIndex:
- 'app/models/article.rb'
- 'app/models/follow.rb'
# Offense count: 34
# Offense count: 38
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
@ -96,7 +100,7 @@ Style/SingleLineBlockParams:
Exclude:
- 'app/labor/markdown_fixer.rb'
# Offense count: 556
# Offense count: 555
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https

View file

@ -4,12 +4,12 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }
port ENV.fetch("PORT", 3000)
# Specifies the `environment` that Puma will run in.
#
@ -24,7 +24,7 @@ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
workers ENV.fetch("WEB_CONCURRENCY", 2)
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code