diff options
author | Stan Hu <stanhu@gmail.com> | 2023-01-23 22:21:05 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2023-01-23 22:21:05 +0300 |
commit | 0615da2ecdc69993f2d9cd09126357a62fe65601 (patch) | |
tree | a965f98875aba111b9537c8f8b13a6cc02408cd4 /ruby | |
parent | 572a65faea5fa4dd9ca17d9c98a82da3f7af9a58 (diff) |
Update Rubocop and regenerate TODO list
We need to update Rubocop to support Ruby 3.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/.rubocop_todo.yml | 285 | ||||
-rw-r--r-- | ruby/Gemfile | 2 | ||||
-rw-r--r-- | ruby/Gemfile.lock | 67 |
3 files changed, 112 insertions, 242 deletions
diff --git a/ruby/.rubocop_todo.yml b/ruby/.rubocop_todo.yml index b0e943dcb..ce4998267 100644 --- a/ruby/.rubocop_todo.yml +++ b/ruby/.rubocop_todo.yml @@ -1,42 +1,21 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-10-08 07:33:21 UTC using RuboCop version 0.86.0. +# on 2023-01-23 19:20:44 UTC using RuboCop version 1.44.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: 6 -# Cop supports --auto-correct. -# Configuration parameters: TreatCommentsAsGroupSeparators, Include. +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemfile, **/Gemfile, **/gems.rb Bundler/OrderedGems: Exclude: - 'Gemfile' -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty_lines, no_empty_lines -Layout/EmptyLinesAroundBlockBody: - Exclude: - - 'lib/gitlab/git/repository.rb' - # Offense count: 1 -Lint/AmbiguousBlockAssociation: - Exclude: - - 'spec/lib/gitlab/git/index_spec.rb' - -# Offense count: 5 -# Configuration parameters: AllowSafeAssignment. -Lint/AssignmentInCondition: - Exclude: - - 'lib/gitaly_server/conflicts_service.rb' - - 'lib/gitaly_server/wiki_service.rb' - - 'lib/gitlab/git/repository.rb' - -# Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Lint/NonDeterministicRequireOrder: Exclude: - 'spec/spec_helper.rb' @@ -46,181 +25,95 @@ Lint/NonLocalExitFromIterator: Exclude: - 'spec/support/helpers/integration_helper.rb' -# Offense count: 3 -# Cop supports --auto-correct. -Lint/RedundantCopDisableDirective: - Exclude: - - 'spec/lib/gitlab/git/popen_spec.rb' - - 'spec/lib/gitlab/git/repository_spec.rb' - -# Offense count: 2 -Lint/ShadowingOuterLocalVariable: - Exclude: - - 'lib/gitlab/git/blob.rb' - - 'lib/gitlab/git/remote_mirror.rb' - -# Offense count: 5 -# Configuration parameters: AllowComments. +# Offense count: 1 +# Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - 'lib/gitaly_server/repository_service.rb' - - 'lib/gitlab/git/hook.rb' - - 'lib/gitlab/git/popen.rb' - - 'spec/lib/gitlab/git/popen_spec.rb' - - 'spec/lib/gitlab/git/repository_spec.rb' -# Offense count: 4 -# Cop supports --auto-correct. +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. Lint/UnusedMethodArgument: Exclude: - 'lib/gitaly_server/sentry_interceptor.rb' - - 'lib/gitlab/git/conflict/parser.rb' -# Offense count: 62 -# Configuration parameters: IgnoredMethods. +# Offense count: 3 +# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: Max: 37 -# Offense count: 70 -# Configuration parameters: CountComments, ExcludedMethods. -# ExcludedMethods: refine +# Offense count: 5 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. +# AllowedMethods: refine Metrics/BlockLength: - Max: 242 + Max: 67 -# Offense count: 8 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 699 - -# Offense count: 7 -# Configuration parameters: IgnoredMethods. +# Offense count: 1 +# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/CyclomaticComplexity: Max: 10 -# Offense count: 82 -# Configuration parameters: CountComments, ExcludedMethods. +# Offense count: 5 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/MethodLength: - Max: 44 + Max: 35 -# Offense count: 16 -# Configuration parameters: CountKeywordArgs. -Metrics/ParameterLists: - Max: 7 - -# Offense count: 6 -# Configuration parameters: IgnoredMethods. +# Offense count: 1 +# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/PerceivedComplexity: Max: 10 -# Offense count: 1 -Naming/AccessorMethodName: - Exclude: - - 'lib/gitaly_server/utils.rb' - -# Offense count: 3 -# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. -# NamePrefix: is_, has_, have_ -# ForbiddenPrefixes: is_, has_, have_ -# AllowedMethods: is_a? -# MethodDefinitionMacros: define_method, define_singleton_method -Naming/PredicateName: - Exclude: - - 'spec/**/*' - - 'lib/gitlab/git/blob.rb' - - 'lib/gitlab/git/gitaly_remote_repository.rb' - - 'lib/gitlab/git/repository.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: prefer_alias, prefer_alias_method -Style/Alias: - Exclude: - - 'lib/gitlab/git/blob.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: Keywords. -# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW -Style/CommentAnnotation: - Exclude: - - 'lib/gitlab/config.rb' - -# Offense count: 65 +# Offense count: 13 +# Configuration parameters: AllowedConstants. Style/Documentation: - Enabled: false - -# Offense count: 1 -# Configuration parameters: EnforcedStyle. -# SupportedStyles: annotated, template, unannotated -Style/FormatStringToken: Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'bin/gitaly-ruby' + - 'lib/gitaly_server.rb' + - 'lib/gitaly_server/health_service.rb' + - 'lib/gitaly_server/repository_service.rb' + - 'lib/gitaly_server/sentry.rb' - 'lib/gitaly_server/sentry_interceptor.rb' + - 'lib/gitaly_server/utils.rb' + - 'lib/gitlab/config.rb' -# Offense count: 95 -# Cop supports --auto-correct. +# Offense count: 19 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 7 -# Configuration parameters: MinBodyLength. -Style/GuardClause: +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/GlobalStdStream: Exclude: - - 'lib/gitlab/git/operation_service.rb' - - 'lib/gitlab/git/repository.rb' + - 'bin/gitaly-ruby' -# Offense count: 3 -# Cop supports --auto-correct. +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedOctalStyle. # SupportedOctalStyles: zero_with_o, zero_only Style/NumericLiteralPrefix: Exclude: - 'bin/gitaly-ruby' - - 'spec/lib/gitlab/git/index_spec.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: Strict. -Style/NumericLiterals: - MinDigits: 6 - -# Offense count: 25 -# Cop supports --auto-correct. -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Exclude: - - 'lib/gitlab/git/blob.rb' - - 'lib/gitlab/git/gitlab_projects.rb' - - 'lib/gitlab/git/index.rb' - - 'spec/lib/gitlab/git/gitlab_projects_spec.rb' - - 'spec/lib/gitlab/git/popen_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: short, verbose -Style/PreferredHashMethods: - Exclude: - - 'lib/gitaly_server/client.rb' -# Offense count: 26 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: compact, exploded -Style/RaiseArgs: +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantFileExtensionInRequire: Exclude: - - 'lib/gitaly_server/client.rb' - - 'lib/gitaly_server/conflicts_service.rb' - - 'lib/gitaly_server/operations_service.rb' - - 'lib/gitaly_server/repository_service.rb' - - 'lib/gitlab/git/operation_service.rb' - - 'lib/gitlab/git/remote_repository.rb' + - 'bin/gitaly-ruby' + - 'lib/gitaly_server.rb' + - 'lib/gitaly_server/sentry_interceptor.rb' + - 'spec/lib/gitaly_server/exception_sanitizer_interceptor_spec.rb' + - 'spec/lib/gitaly_server/sentry/url_sanitizer_spec.rb' + - 'spec/lib/gitaly_server/sentry_interceptor_spec.rb' + - 'spec/spec_helper.rb' -# Offense count: 14 -# Cop supports --auto-correct. +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, explicit Style/RescueStandardError: @@ -230,58 +123,44 @@ Style/RescueStandardError: - 'spec/lib/gitaly_server/exception_sanitizer_interceptor_spec.rb' - 'spec/lib/gitaly_server/sentry/url_sanitizer_spec.rb' - 'spec/lib/gitaly_server/sentry_interceptor_spec.rb' - - 'spec/lib/gitlab/git/popen_spec.rb' - 'spec/support/helpers/integration_helper.rb' -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: . -# SupportedStyles: use_perl_names, use_english_names +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: RequireEnglish. +# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names Style/SpecialGlobalVars: EnforcedStyle: use_perl_names -# Offense count: 305 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. -# SupportedStyles: single_quotes, double_quotes -Style/StringLiterals: - Enabled: false - # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: . -# SupportedStyles: percent, brackets -Style/SymbolArray: - EnforcedStyle: percent - MinSize: 10 - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method -Style/SymbolProc: +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: Exclude: - - 'spec/lib/gitlab/git/rev_list_spec.rb' + - 'bin/gitaly-ruby' + - 'spec/factories/gitaly/commit.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods. -# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym -Style/TrivialAccessors: +# Offense count: 28 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: Exclude: - - 'lib/gitlab/git/gitlab_projects.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: WordRegex. -# SupportedStyles: percent, brackets -Style/WordArray: - EnforcedStyle: percent - MinSize: 3 + - 'bin/gitaly-ruby' + - 'lib/gitaly_server/repository_service.rb' + - 'lib/gitaly_server/sentry_interceptor.rb' + - 'spec/factories/gitaly/commit.rb' + - 'spec/lib/gitaly_server/exception_sanitizer_interceptor_spec.rb' + - 'spec/lib/gitaly_server/sentry/url_sanitizer_spec.rb' + - 'spec/lib/gitaly_server/sentry_interceptor_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/support/helpers/integration_helper.rb' + - 'spec/support/sentry.rb' + - 'spec/test_repo_helper.rb' -# Offense count: 39 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: - Max: 199 + Max: 141 diff --git a/ruby/Gemfile b/ruby/Gemfile index 9c561119f..17ed46af2 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -26,7 +26,7 @@ gem 'google-protobuf', '~> 3.21.12' gem 'redis', '~> 4.8.0' group :development, :test do - gem 'rubocop', '~> 0.69', require: false + gem 'rubocop', '~> 1.38', require: false gem 'rspec', require: false gem 'rspec-parameterized', require: false gem 'timecop', require: false diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 2b90a2e0c..cb4eef5c9 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,7 +1,6 @@ GEM remote: https://rubygems.org/ specs: - abstract_type (0.0.7) actionpack (6.1.6.1) actionview (= 6.1.6.1) activesupport (= 6.1.6.1) @@ -21,23 +20,18 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - adamantium (0.2.0) - ice_nine (~> 0.11.0) - memoizable (~> 0.4.0) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) - binding_ninja (0.2.3) + binding_of_caller (1.0.0) + debug_inspector (>= 0.0.1) builder (3.2.4) coderay (1.1.2) - concord (0.1.5) - adamantium (~> 0.2.0) - equalizer (~> 0.0.9) concurrent-ruby (1.1.10) crass (1.0.6) + debug_inspector (1.1.0) diff-lcs (1.3) dotenv (2.7.6) - equalizer (0.0.11) erubi (1.11.0) factory_bot (5.0.2) activesupport (>= 4.2.0) @@ -70,10 +64,10 @@ GEM googleapis-common-protos-types (~> 1.0) i18n (1.12.0) concurrent-ruby (~> 1.0) - ice_nine (0.11.2) jaeger-client (1.1.0) opentracing (~> 0.3) thrift + json (2.6.3) licensee (9.15.2) dotenv (~> 2.0) octokit (~> 4.20) @@ -83,8 +77,6 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - memoizable (0.4.2) - thread_safe (~> 0.3, >= 0.3.1) method_source (0.9.2) mini_portile2 (2.8.0) minitest (5.16.3) @@ -98,8 +90,8 @@ GEM sawyer (~> 0.8.0, >= 0.5.3) opentracing (0.5.0) optimist (3.0.1) - parallel (1.19.2) - parser (3.0.3.2) + parallel (1.22.1) + parser (3.2.0.0) ast (~> 2.4.1) pg_query (2.2.0) google-protobuf (>= 3.19.2) @@ -107,7 +99,6 @@ GEM coderay parser unparser - procto (0.0.3) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) @@ -121,13 +112,13 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.4.4) loofah (~> 2.19, >= 2.19.1) - rainbow (3.0.0) + rainbow (3.1.1) rbtrace (0.4.14) ffi (>= 1.0.6) msgpack (>= 0.4.3) optimist (>= 3.0.0) redis (4.8.0) - regexp_parser (1.8.1) + regexp_parser (2.6.2) reverse_markdown (1.4.0) nokogiri rexml (3.2.5) @@ -143,25 +134,31 @@ GEM rspec-mocks (3.8.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) - rspec-parameterized (0.4.2) - binding_ninja (>= 0.2.3) + rspec-parameterized (1.0.0) + rspec-parameterized-core (< 2) + rspec-parameterized-table_syntax (< 2) + rspec-parameterized-core (1.0.0) parser proc_to_ast rspec (>= 2.13, < 4) unparser + rspec-parameterized-table_syntax (1.0.0) + binding_of_caller + rspec-parameterized-core (< 2) rspec-support (3.8.0) - rubocop (0.86.0) + rubocop (1.44.0) + json (~> 2.3) parallel (~> 1.10) - parser (>= 2.7.0.1) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) - rexml - rubocop-ast (>= 0.0.3, < 1.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.2.0) - parser (>= 2.7.0.1) - ruby-progressbar (1.10.1) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.24.1) + parser (>= 3.1.1.0) + ruby-progressbar (1.11.0) rubyzip (2.3.2) rugged (1.2.0) sawyer (0.8.2) @@ -170,21 +167,15 @@ GEM sentry-raven (3.0.4) faraday (>= 1.0) thor (1.1.0) - thread_safe (0.3.6) thrift (0.17.0) timecop (0.9.1) tomlrb (2.0.1) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (1.7.0) - unparser (0.4.7) - abstract_type (~> 0.0.7) - adamantium (~> 0.2.0) - concord (~> 0.1.5) + unicode-display_width (2.4.2) + unparser (0.6.7) diff-lcs (~> 1.3) - equalizer (~> 0.0.9) - parser (>= 2.6.5) - procto (~> 0.0.2) + parser (>= 3.2.0) with_env (1.1.0) xml-simple (1.1.9) rexml @@ -208,7 +199,7 @@ DEPENDENCIES redis (~> 4.8.0) rspec rspec-parameterized - rubocop (~> 0.69) + rubocop (~> 1.38) rugged (~> 1.2) sentry-raven (~> 3.0) timecop |