]> git.openstreetmap.org Git - rails.git/blobdiff - .rubocop.yml
Merge branch 'pull/4990'
[rails.git] / .rubocop.yml
index f12f24a9f4c0b4a6215032efadfed4a27845042d..68a7ca003eeacb82f949eb247fc3a4a6aaecff02 100644 (file)
 inherit_from: .rubocop_todo.yml
 
 inherit_from: .rubocop_todo.yml
 
+require:
+  - rubocop-capybara
+  - rubocop-factory_bot
+  - rubocop-minitest
+  - rubocop-performance
+  - rubocop-rails
+  - rubocop-rake
+  - ./.rubocop/specific_action_names.rb
+
+AllCops:
+  TargetRubyVersion: 3.1
+  NewCops: enable
+  Exclude:
+    - 'vendor/**/*'
+
 Rails:
   Enabled: true
 
 Rails:
   Enabled: true
 
-Style/BracesAroundHashParameters:
-  EnforcedStyle: context_dependent
-
-Style/ExtraSpacing:
+Layout/ExtraSpacing:
   AllowForAlignment: true
 
   AllowForAlignment: true
 
-Style/FileName:
+Lint/PercentStringArray:
+  Exclude:
+    - 'config/initializers/secure_headers.rb'
+    - 'app/controllers/application_controller.rb'
+    - 'app/controllers/site_controller.rb'
+
+Metrics/BlockLength:
+  Exclude:
+    - 'config/routes.rb'
+
+Metrics/ClassLength:
+  Exclude:
+    - 'test/**/*'
+
+Metrics/ModuleLength:
+  Max: 150
+
+Naming/FileName:
   Exclude:
     - 'script/deliver-message'
   Exclude:
     - 'script/deliver-message'
-    - 'script/locale/reload-languages'
     - 'script/update-spam-blocks'
 
     - 'script/update-spam-blocks'
 
-Style/IfInsideElse:
+Naming/MethodParameterName:
+  Enabled: false
+
+# This conflicts with Strong Migrations, which can't check `change_table`
+Rails/BulkChangeTable:
+  Enabled: false
+
+Rails/CreateTableWithTimestamps:
+  Enabled: false
+
+Rails/FindBy:
+  IgnoreWhereFirst: false
+
+Rails/FindEach:
+  Enabled: false
+
+Rails/HasManyOrHasOneDependent:
+  Enabled: false
+
+Rails/HttpPositionalArguments:
+  Enabled: false
+
+Rails/ReflectionClassName:
   Enabled: false
 
   Enabled: false
 
-Style/GlobalVars:
+Rails/SkipsModelValidations:
   Exclude:
   Exclude:
-    - 'lib/quad_tile/extconf.rb'
+    - 'db/migrate/*.rb'
+    - 'app/controllers/users/lists_controller.rb'
+
+Style/Documentation:
+  Enabled: false
+
+Style/FormatStringToken:
+  Exclude:
+    - 'config/routes.rb'
+
+Style/IfInsideElse:
+  Enabled: false
 
 Style/GuardClause:
   Enabled: false
 
 
 Style/GuardClause:
   Enabled: false
 
+Style/HashEachMethods:
+  Enabled: true
+
 Style/HashSyntax:
   EnforcedStyle: hash_rockets
   Exclude:
     - 'lib/tasks/testing.rake'
     - 'config/initializers/wrap_parameters.rb'
 
 Style/HashSyntax:
   EnforcedStyle: hash_rockets
   Exclude:
     - 'lib/tasks/testing.rake'
     - 'config/initializers/wrap_parameters.rb'
 
+Style/HashTransformKeys:
+  Enabled: true
+
+Style/HashTransformValues:
+  Enabled: true
+
+Style/MixinUsage:
+  Exclude:
+    - 'bin/setup'
+    - 'bin/update'
+
 Style/StringLiterals:
   EnforcedStyle: double_quotes
 Style/StringLiterals:
   EnforcedStyle: double_quotes
+
+Style/SymbolArray:
+  EnforcedStyle: brackets
+
+Rails/SpecificActionNames:
+  Description: Use only specific action names.
+  Enabled: true
+  ActionNames:
+    - index
+    - show
+    - new
+    - edit
+    - create
+    - update
+    - destroy
+  Include:
+    - app/controllers/**/*.rb
+  Exclude:
+    # This is a todo list, but is currently too long for `rubocop --auto-gen-config`
+    - 'app/controllers/api/changeset_comments_controller.rb'
+    - 'app/controllers/api/changesets_controller.rb'
+    - 'app/controllers/api/nodes_controller.rb'
+    - 'app/controllers/api/notes_controller.rb'
+    - 'app/controllers/api/old_elements_controller.rb'
+    - 'app/controllers/api/relations_controller.rb'
+    - 'app/controllers/api/user_preferences_controller.rb'
+    - 'app/controllers/api/users_controller.rb'
+    - 'app/controllers/api/ways_controller.rb'
+    - 'app/controllers/browse_controller.rb'
+    - 'app/controllers/changesets_controller.rb'
+    - 'app/controllers/confirmations_controller.rb'
+    - 'app/controllers/diary_comments_controller.rb'
+    - 'app/controllers/diary_entries_controller.rb'
+    - 'app/controllers/directions_controller.rb'
+    - 'app/controllers/errors_controller.rb'
+    - 'app/controllers/export_controller.rb'
+    - 'app/controllers/geocoder_controller.rb'
+    - 'app/controllers/issues_controller.rb'
+    - 'app/controllers/site_controller.rb'
+    - 'app/controllers/traces_controller.rb'
+    - 'app/controllers/users_controller.rb'