-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.reek
60 lines (56 loc) · 1.33 KB
/
config.reek
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Do not require a descriptive comment for classes and modules
# See: https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md
IrresponsibleModule:
enabled: false
# Allow 2 occurrences of a method call. When adding the third, it should be
# extracted to a variable or method.
# See: https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md
#
# == Examples:
#
# Allowed:
#
# def search
# if params[:query].present?
# @results = Model.search(params[:query])
# end
# end
#
# Not allowed:
#
# def search
# if params[:query].present?
# @results = Model.search(params[:query])
# session[:last_search_query] = params[:query]
# end
# end
#
# Refactor to:
#
# def search
# if search_query.present?
# @results = Model.search(search_query)
# session[:last_search_query] = search_query
# end
# end
#
# private
#
# def search_query
# params[:query]
# end
DuplicateMethodCall:
enabled: true
max_calls: 2
# Allow modules named "V1", because that is fairly common for Rails apps to have
UncommunicativeModuleName:
accept:
- V1
# Allow Rails helpers that do not depend on instance state
"app/helpers":
UtilityFunction:
enabled: false
# Allow spec helpers that do not depend on instance state
"spec/support":
UtilityFunction:
enabled: false