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