-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop-custom.yml
125 lines (110 loc) · 2.96 KB
/
.rubocop-custom.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
AllCops:
NewCops: enable
# Check if the code style follows the structure configuration
Layout/ClassStructure:
Enabled: true
# Order of declaration in Categories is not verified by Rubocop (belongs_to can be before of after has_many)
Categories:
association:
- belongs_to
- has_one
- has_many
- has_and_belongs_to_many
attribute_macros:
- attr_reader
- attr_writer
- attr_accessor
callbacks:
- before_save
- before_create
- after_save
- after_create
macros:
- has_one_attached
- has_many_attached
- has_rich_text
- validates
- validate
module_inclusion:
- include
- prepend
- extend
ExpectedOrder:
- module_inclusion
- constants
- enum
- public_attribute_macros
- association
- macros
- callbacks
- public_class_methods
- initializer
- public_delegate
- public_methods
- protected_attribute_macros
- protected_methods
- private_attribute_macros
- private_delegate
- private_methods
# Align ends correctly.
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
# This cops checks the indentation of the first key in a hash literal where the opening brace and the first key are on separate lines.
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# This cop checks for ambiguous block association with method when param passed without parentheses.
Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*.rb"
# This cop looks for error classes inheriting from `Exception` and its standard library subclasses, excluding subclasses of `StandardError`.
Lint/InheritException:
EnforcedStyle: standard_error
Naming/BlockForwarding: # new in 1.24
Enabled: true
EnforcedStyle: explicit
Naming/MethodParameterName:
AllowedNames:
- i
- j
- x
- y
# This cop makes sure that all numbered variables use the configured style, snake_case, normalcase, or non_integer, for their numbering.
Naming/VariableNumber:
EnforcedStyle: snake_case
CheckSymbols: false
CheckMethodNames: false
Rails/ActionOrder:
ExpectedOrder:
- index
- new
- create
- show
- edit
- update
- destroy
Rails/DynamicFindBy:
AllowedMethods:
- find_by_password_reset_token! # Related to Rails authentication
# This cop checks for consistent uses of request.referer or request.referrer, depending on the cop's configuration.
Rails/RequestReferer:
EnforcedStyle: referer
# This cop checks that environments called with Rails.env predicates exist.
Rails/UnknownEnv:
Environments:
- development
- test
- staging
- production
# Check for the formatting of empty method definitions.
Style/EmptyMethod:
EnforcedStyle: expanded
Style/HashSyntax:
EnforcedShorthandSyntax: never
# Use `%`-literal delimiters consistently.
Style/PercentLiteralDelimiters:
PreferredDelimiters:
default: "()"
"%i": "[]"
"%w": "[]"
"%W": "[]"
"%r": "{}"