]> git.openstreetmap.org Git - rails.git/blob - .rubocop.yml
Merge remote-tracking branch 'upstream/pull/6412'
[rails.git] / .rubocop.yml
1 inherit_from: .rubocop_todo.yml
2
3 plugins:
4   - rubocop-capybara
5   - rubocop-factory_bot
6   - rubocop-minitest
7   - rubocop-performance
8   - rubocop-rails
9   - rubocop-rake
10
11 require:
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 Metrics/BlockLength:
27   Exclude:
28     - 'config/routes.rb'
29
30 Metrics/ClassLength:
31   Exclude:
32     - 'test/**/*'
33
34 Metrics/ModuleLength:
35   Max: 150
36
37 Naming/FileName:
38   Exclude:
39     - 'script/deliver-message'
40     - 'script/update-spam-blocks'
41
42 Naming/MethodParameterName:
43   Enabled: false
44
45 Naming/PredicateMethod:
46   AllowBangMethods: true
47
48 # This conflicts with Strong Migrations, which can't check `change_table`
49 Rails/BulkChangeTable:
50   Enabled: false
51
52 Rails/CreateTableWithTimestamps:
53   Enabled: false
54
55 Rails/FindBy:
56   IgnoreWhereFirst: false
57
58 Rails/FindEach:
59   Enabled: false
60
61 Rails/HasManyOrHasOneDependent:
62   Enabled: false
63
64 Rails/HttpPositionalArguments:
65   Enabled: false
66
67 Rails/ReflectionClassName:
68   Enabled: false
69
70 Rails/SkipsModelValidations:
71   Exclude:
72     - 'db/migrate/*.rb'
73     - 'app/controllers/users/lists_controller.rb'
74
75 Style/CollectionQuerying:
76   Exclude:
77     - 'Dangerfile'
78
79 Style/Documentation:
80   Enabled: false
81
82 Style/FrozenStringLiteralComment:
83   Enabled: true
84   EnforcedStyle: always_true
85
86 Style/IfInsideElse:
87   Enabled: false
88
89 Style/GuardClause:
90   Enabled: false
91
92 Style/HashEachMethods:
93   Enabled: true
94
95 Style/HashSyntax:
96   EnforcedStyle: hash_rockets
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/RaiseArgs:
110   Exclude:
111     - 'lib/osm.rb'
112
113 Style/StringLiterals:
114   EnforcedStyle: double_quotes
115
116 Style/SymbolArray:
117   EnforcedStyle: brackets
118
119 Rails/SpecificActionNames:
120   Description: Use only specific action names.
121   Enabled: true
122   ActionNames:
123     - index
124     - show
125     - new
126     - edit
127     - create
128     - update
129     - destroy
130   Include:
131     - app/controllers/**/*.rb
132   Exclude:
133     # This is a todo list, but is currently too long for `rubocop --auto-gen-config`
134     - 'app/controllers/api/notes_controller.rb'
135     - 'app/controllers/api/user_preferences_controller.rb'
136     - 'app/controllers/api/users_controller.rb'
137     - 'app/controllers/changesets_controller.rb'
138     - 'app/controllers/confirmations_controller.rb'
139     - 'app/controllers/diary_comments_controller.rb'
140     - 'app/controllers/diary_entries_controller.rb'
141     - 'app/controllers/errors_controller.rb'
142     - 'app/controllers/export_controller.rb'
143     - 'app/controllers/issues_controller.rb'
144     - 'app/controllers/site_controller.rb'
145     - 'app/controllers/traces_controller.rb'
146     - 'app/controllers/users_controller.rb'