From 1d3720001412569b37543f1c9c31584e3ee71225 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 10 Jan 2025 12:07:35 -0600 Subject: [PATCH] Add new rubocop rules --- .rubocop.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++ .rubocop_todo.yml | 30 +++++++++++++-------- 2 files changed, 85 insertions(+), 11 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 03c60443..7d2a1c94 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -440,3 +440,69 @@ Rails/WhereNotWithMultipleConditions: # new in 2.17 Enabled: true Rails/WhereRange: # new in 2.25 Enabled: true +Gemspec/AddRuntimeDependency: # new in 1.65 + Enabled: true +Lint/DuplicateSetElement: # new in 1.67 + Enabled: true +Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69 + Enabled: true +Lint/NumericOperationWithConstantResult: # new in 1.69 + Enabled: true +Lint/UnescapedBracketInRegexp: # new in 1.68 + Enabled: true +Lint/UselessDefined: # new in 1.69 + Enabled: true +Lint/UselessNumericOperation: # new in 1.66 + Enabled: true +Style/AmbiguousEndlessMethodDefinition: # new in 1.68 + Enabled: true +Style/BitwisePredicate: # new in 1.68 + Enabled: true +Style/CombinableDefined: # new in 1.68 + Enabled: true +Style/DigChain: # new in 1.69 + Enabled: true +Style/FileNull: # new in 1.69 + Enabled: true +Style/FileTouch: # new in 1.69 + Enabled: true +Style/KeywordArgumentsMerging: # new in 1.68 + Enabled: true +Style/RedundantInterpolationUnfreeze: # new in 1.66 + Enabled: true +Style/SafeNavigationChainLength: # new in 1.68 + Enabled: true +Performance/StringBytesize: # new in 1.23 + Enabled: true +Rails/EnumSyntax: # new in 2.26 + Enabled: true +RSpec/StringAsInstanceDoubleConstant: # new in 3.1 + Enabled: true +FactoryBot/AssociationStyle: # new in 2.23 + Enabled: true +FactoryBot/ConsistentParenthesesStyle: # new in 2.14 + Enabled: true +FactoryBot/ExcessiveCreateList: # new in 2.25 + Enabled: true +FactoryBot/FactoryAssociationWithStrategy: # new in 2.23 + Enabled: true +FactoryBot/FactoryNameStyle: # new in 2.16 + Enabled: true +FactoryBot/IdSequence: # new in 2.24 + Enabled: true +FactoryBot/RedundantFactoryOption: # new in 2.23 + Enabled: true +FactoryBot/SyntaxMethods: # new in 2.7 + Enabled: true +RSpecRails/AvoidSetupHook: # new in 2.4 + Enabled: true +RSpecRails/HaveHttpStatus: # new in 2.12 + Enabled: true +RSpecRails/InferredSpecType: # new in 2.14 + Enabled: true +RSpecRails/MinitestAssertions: # new in 2.17 + Enabled: true +RSpecRails/NegationBeValid: # new in 2.23 + Enabled: true +RSpecRails/TravelAround: # new in 2.19 + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e2c409d7..dfa6e138 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-06-17 18:36:49 UTC using RuboCop version 1.64.1. +# on 2025-01-10 18:06:58 UTC using RuboCop version 1.69.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 @@ -16,6 +16,14 @@ Capybara/RSpec/HaveSelector: - 'spec/components/owner_field_component_spec.rb' - 'spec/requests/contributors_spec.rb' +# Offense count: 2 +# Configuration parameters: Include, MaxAmount. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +FactoryBot/ExcessiveCreateList: + Exclude: + - 'spec/controllers/transform_results_controller_spec.rb' + - 'spec/requests/transform_result_spec.rb' + # Offense count: 2 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: @@ -38,14 +46,6 @@ Naming/MethodParameterName: Exclude: - 'app/models/dlme_json.rb' -# Offense count: 16 -# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. -# SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 -Naming/VariableNumber: - Exclude: - - 'spec/features/bulk_resource_delete_spec.rb' - # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. @@ -72,11 +72,10 @@ RSpec/ExpectChange: Exclude: - 'spec/controllers/dlme_jsons_controller_spec.rb' -# Offense count: 18 +# Offense count: 2 # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. RSpec/IndexedLet: Exclude: - - 'spec/features/bulk_resource_delete_spec.rb' - 'spec/models/statistics_dashboard_spec.rb' # Offense count: 12 @@ -139,6 +138,15 @@ Style/ReturnNilInPredicateMethodDefinition: Exclude: - 'app/models/solr_document.rb' +# Offense count: 4 +# Configuration parameters: Max. +Style/SafeNavigationChainLength: + Exclude: + - 'app/processors/autolink.rb' + - 'app/processors/bidi_wrap.rb' + - 'app/processors/collapse.rb' + - 'app/processors/paragraph.rb' + # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/SingleArgumentDig: