]> 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 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/IfInsideElse:
83   Enabled: false
84
85 Style/GuardClause:
86   Enabled: false
87
88 Style/HashEachMethods:
89   Enabled: true
90
91 Style/HashSyntax:
92   EnforcedStyle: hash_rockets
93
94 Style/HashTransformKeys:
95   Enabled: true
96
97 Style/HashTransformValues:
98   Enabled: true
99
100 Style/MixinUsage:
101   Exclude:
102     - 'bin/setup'
103     - 'bin/update'
104
105 Style/RaiseArgs:
106   Exclude:
107     - 'lib/osm.rb'
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/notes_controller.rb'
131     - 'app/controllers/api/user_preferences_controller.rb'
132     - 'app/controllers/api/users_controller.rb'
133     - 'app/controllers/changesets_controller.rb'
134     - 'app/controllers/confirmations_controller.rb'
135     - 'app/controllers/diary_comments_controller.rb'
136     - 'app/controllers/diary_entries_controller.rb'
137     - 'app/controllers/errors_controller.rb'
138     - 'app/controllers/export_controller.rb'
139     - 'app/controllers/issues_controller.rb'
140     - 'app/controllers/site_controller.rb'
141     - 'app/controllers/traces_controller.rb'
142     - 'app/controllers/users_controller.rb'