]> git.openstreetmap.org Git - rails.git/blob - .rubocop.yml
Merge remote-tracking branch 'upstream/pull/5726'
[rails.git] / .rubocop.yml
1 inherit_from: .rubocop_todo.yml
2
3 plugins:
4   - rubocop-minitest
5   - rubocop-performance
6   - rubocop-rails
7   - rubocop-rake
8
9 require:
10   - rubocop-capybara
11   - rubocop-factory_bot
12   - ./.rubocop/specific_action_names.rb
13
14 AllCops:
15   TargetRubyVersion: 3.2
16   NewCops: enable
17   Exclude:
18     - 'vendor/**/*'
19
20 Rails:
21   Enabled: true
22
23 Layout/ExtraSpacing:
24   AllowForAlignment: true
25
26 Lint/PercentStringArray:
27   Exclude:
28     - 'config/initializers/secure_headers.rb'
29     - 'app/controllers/application_controller.rb'
30     - 'app/controllers/site_controller.rb'
31
32 Metrics/BlockLength:
33   Exclude:
34     - 'config/routes.rb'
35
36 Metrics/ClassLength:
37   Exclude:
38     - 'test/**/*'
39
40 Metrics/ModuleLength:
41   Max: 150
42
43 Naming/FileName:
44   Exclude:
45     - 'script/deliver-message'
46     - 'script/update-spam-blocks'
47
48 Naming/MethodParameterName:
49   Enabled: false
50
51 # This conflicts with Strong Migrations, which can't check `change_table`
52 Rails/BulkChangeTable:
53   Enabled: false
54
55 Rails/CreateTableWithTimestamps:
56   Enabled: false
57
58 Rails/FindBy:
59   IgnoreWhereFirst: false
60
61 Rails/FindEach:
62   Enabled: false
63
64 Rails/HasManyOrHasOneDependent:
65   Enabled: false
66
67 Rails/HttpPositionalArguments:
68   Enabled: false
69
70 Rails/ReflectionClassName:
71   Enabled: false
72
73 Rails/SkipsModelValidations:
74   Exclude:
75     - 'db/migrate/*.rb'
76     - 'app/controllers/users/lists_controller.rb'
77
78 Style/Documentation:
79   Enabled: false
80
81 Style/FormatStringToken:
82   Exclude:
83     - 'config/routes.rb'
84
85 Style/IfInsideElse:
86   Enabled: false
87
88 Style/GuardClause:
89   Enabled: false
90
91 Style/HashEachMethods:
92   Enabled: true
93
94 Style/HashSyntax:
95   EnforcedStyle: hash_rockets
96   Exclude:
97     - 'lib/tasks/testing.rake'
98     - 'config/initializers/wrap_parameters.rb'
99
100 Style/HashTransformKeys:
101   Enabled: true
102
103 Style/HashTransformValues:
104   Enabled: true
105
106 Style/MixinUsage:
107   Exclude:
108     - 'bin/setup'
109     - 'bin/update'
110
111 Style/RaiseArgs:
112   Exclude:
113     - 'lib/osm.rb'
114
115 Style/StringLiterals:
116   EnforcedStyle: double_quotes
117
118 Style/SymbolArray:
119   EnforcedStyle: brackets
120
121 Rails/SpecificActionNames:
122   Description: Use only specific action names.
123   Enabled: true
124   ActionNames:
125     - index
126     - show
127     - new
128     - edit
129     - create
130     - update
131     - destroy
132   Include:
133     - app/controllers/**/*.rb
134   Exclude:
135     # This is a todo list, but is currently too long for `rubocop --auto-gen-config`
136     - 'app/controllers/api/changesets_controller.rb'
137     - 'app/controllers/api/notes_controller.rb'
138     - 'app/controllers/api/user_preferences_controller.rb'
139     - 'app/controllers/api/users_controller.rb'
140     - 'app/controllers/browse_controller.rb'
141     - 'app/controllers/changesets_controller.rb'
142     - 'app/controllers/confirmations_controller.rb'
143     - 'app/controllers/diary_comments_controller.rb'
144     - 'app/controllers/diary_entries_controller.rb'
145     - 'app/controllers/directions_controller.rb'
146     - 'app/controllers/errors_controller.rb'
147     - 'app/controllers/export_controller.rb'
148     - 'app/controllers/geocoder_controller.rb'
149     - 'app/controllers/issues_controller.rb'
150     - 'app/controllers/site_controller.rb'
151     - 'app/controllers/traces_controller.rb'
152     - 'app/controllers/users_controller.rb'