-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.rubocop.yml
More file actions
143 lines (115 loc) · 3.83 KB
/
.rubocop.yml
File metadata and controls
143 lines (115 loc) · 3.83 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Default enabled cops
# https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
plugins:
- rubocop-performance
- rubocop-rake
- rubocop-rspec
inherit_from:
- .rubocop_todo.yml
AllCops:
NewCops: enable
Exclude:
- 'bin/rails'
- 'bin/rake'
- 'bin/spring'
- 'db/schema.rb'
- 'examples/**/*'
# Match the Ruby version specified in the gemspec.
TargetRubyVersion: 3.0
# Zammad StyleGuide
Style/FrozenStringLiteralComment:
Enabled: false
Style/NegatedIf:
Description: >-
Favor unless over if for negative conditions
(or control flow or).
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
Enabled: false
Style/IfUnlessModifier:
Description: >-
Favor modifier if/unless usage when you have a
single-line body.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
Enabled: false
Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.'
StyleGuide: '#no-trailing-array-commas'
Enabled: false
Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.'
Enabled: false
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
Enabled: false
Layout/LeadingCommentSpace:
Description: 'Comments should start with a space.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
Enabled: false
Layout/HashAlignment:
Description: >-
Align the elements of a hash literal if they span more than
one line.
Enabled: true
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
EnforcedLastArgumentHashStyle: always_inspect
Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.'
Enabled: false
Naming/MethodParameterName:
Description: >-
Checks for method parameter names that contain capital letters,
end in numbers, or do not meet a minimal length.
Enabled: true
AllowedNames: [id]
Layout/MultilineMethodCallIndentation:
Description: >-
Checks the indentation of the method name part in method calls
that span more than one line.
EnforcedStyle: indented
Style/RescueStandardError:
EnforcedStyle: implicit
Style/Documentation:
Enabled: false
Style/PerlBackrefs:
Description: 'Avoid Perl-style regex back references.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
Enabled: false
Style/BlockComments:
# Keep block comments (=begin ... =end) to allow for easy copy-pasting of examples.
Description: 'Do not use block comments.'
Enabled: false
Layout/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Enabled: false
Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: false
Metrics/MethodLength:
Description: 'Avoid methods longer than 10 lines of code.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
Enabled: false
Metrics/AbcSize:
Max: 34
Metrics/CyclomaticComplexity:
Max: 12
Metrics/PerceivedComplexity:
Max: 12
RSpec/ExampleLength:
inherit_mode:
merge:
- Exclude
CountAsOne:
- 'array'
- 'hash'
- 'heredoc'
Max: 25
RSpec/NestedGroups:
Max: 6
# Broken!!!! Generates broken code since "String".downcase == "strinG".downcase is not equals "String".casecmp("strinG") but "String".casecmp("strinG") == 0 !!!
Performance/Casecmp:
Description: 'Use `casecmp` rather than `downcase ==`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
Enabled: false