fortnox-api 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +9 -1104
  4. data/.travis.yml +22 -2
  5. data/Gemfile +3 -1
  6. data/Guardfile +4 -2
  7. data/README.md +2 -2
  8. data/Rakefile +3 -1
  9. data/bin/console +17 -3
  10. data/fortnox-api.gemspec +32 -27
  11. data/lib/fortnox/api.rb +17 -16
  12. data/lib/fortnox/api/circular_queue.rb +13 -7
  13. data/lib/fortnox/api/mappers.rb +29 -25
  14. data/lib/fortnox/api/mappers/article.rb +7 -6
  15. data/lib/fortnox/api/mappers/base.rb +18 -16
  16. data/lib/fortnox/api/mappers/base/from_json.rb +37 -30
  17. data/lib/fortnox/api/mappers/base/to_json.rb +39 -37
  18. data/lib/fortnox/api/mappers/customer.rb +7 -7
  19. data/lib/fortnox/api/mappers/default_delivery_types.rb +4 -2
  20. data/lib/fortnox/api/mappers/default_templates.rb +5 -4
  21. data/lib/fortnox/api/mappers/edi_information.rb +5 -4
  22. data/lib/fortnox/api/mappers/email_information.rb +5 -4
  23. data/lib/fortnox/api/mappers/invoice.rb +10 -8
  24. data/lib/fortnox/api/mappers/invoice_row.rb +12 -7
  25. data/lib/fortnox/api/mappers/order.rb +10 -7
  26. data/lib/fortnox/api/mappers/order_row.rb +13 -6
  27. data/lib/fortnox/api/mappers/project.rb +6 -4
  28. data/lib/fortnox/api/mappers/terms_of_payments.rb +17 -0
  29. data/lib/fortnox/api/mappers/unit.rb +17 -0
  30. data/lib/fortnox/api/models.rb +9 -5
  31. data/lib/fortnox/api/models/article.rb +68 -67
  32. data/lib/fortnox/api/models/base.rb +52 -36
  33. data/lib/fortnox/api/models/customer.rb +95 -94
  34. data/lib/fortnox/api/models/document.rb +186 -0
  35. data/lib/fortnox/api/models/invoice.rb +44 -44
  36. data/lib/fortnox/api/models/label.rb +5 -3
  37. data/lib/fortnox/api/models/order.rb +8 -8
  38. data/lib/fortnox/api/models/project.rb +10 -8
  39. data/lib/fortnox/api/models/terms_of_payments.rb +28 -0
  40. data/lib/fortnox/api/models/unit.rb +24 -0
  41. data/lib/fortnox/api/repositories.rb +9 -5
  42. data/lib/fortnox/api/repositories/article.rb +6 -4
  43. data/lib/fortnox/api/repositories/base.rb +49 -46
  44. data/lib/fortnox/api/repositories/base/loaders.rb +32 -36
  45. data/lib/fortnox/api/repositories/base/savers.rb +23 -21
  46. data/lib/fortnox/api/repositories/customer.rb +6 -4
  47. data/lib/fortnox/api/repositories/invoice.rb +6 -4
  48. data/lib/fortnox/api/repositories/order.rb +6 -4
  49. data/lib/fortnox/api/repositories/project.rb +6 -4
  50. data/lib/fortnox/api/repositories/terms_of_payments.rb +17 -0
  51. data/lib/fortnox/api/repositories/unit.rb +17 -0
  52. data/lib/fortnox/api/request_handling.rb +12 -12
  53. data/lib/fortnox/api/types.rb +62 -11
  54. data/lib/fortnox/api/types/default_delivery_types.rb +5 -3
  55. data/lib/fortnox/api/types/default_templates.rb +3 -1
  56. data/lib/fortnox/api/types/defaulted.rb +2 -2
  57. data/lib/fortnox/api/types/document_row.rb +41 -42
  58. data/lib/fortnox/api/types/edi_information.rb +10 -8
  59. data/lib/fortnox/api/types/email_information.rb +10 -8
  60. data/lib/fortnox/api/types/enums.rb +60 -47
  61. data/lib/fortnox/api/types/invoice_row.rb +8 -8
  62. data/lib/fortnox/api/types/model.rb +14 -10
  63. data/lib/fortnox/api/types/nullable.rb +7 -7
  64. data/lib/fortnox/api/types/order_row.rb +5 -5
  65. data/lib/fortnox/api/types/required.rb +5 -5
  66. data/lib/fortnox/api/types/sized.rb +14 -6
  67. data/lib/fortnox/api/version.rb +3 -1
  68. data/spec/fortnox/api/mappers/article_spec.rb +3 -1
  69. data/spec/fortnox/api/mappers/base/from_json_spec.rb +15 -13
  70. data/spec/fortnox/api/mappers/base/to_json_spec.rb +4 -3
  71. data/spec/fortnox/api/mappers/base_spec.rb +40 -35
  72. data/spec/fortnox/api/mappers/contexts/json_conversion.rb +12 -11
  73. data/spec/fortnox/api/mappers/customer_spec.rb +3 -1
  74. data/spec/fortnox/api/mappers/default_delivery_types_spec.rb +3 -1
  75. data/spec/fortnox/api/mappers/edi_information_spec.rb +4 -2
  76. data/spec/fortnox/api/mappers/email_information_spec.rb +4 -2
  77. data/spec/fortnox/api/mappers/examples/mapper.rb +17 -9
  78. data/spec/fortnox/api/mappers/invoice_row_spec.rb +8 -3
  79. data/spec/fortnox/api/mappers/invoice_spec.rb +4 -1
  80. data/spec/fortnox/api/mappers/order_row_spec.rb +9 -2
  81. data/spec/fortnox/api/mappers/order_spec.rb +4 -1
  82. data/spec/fortnox/api/mappers/project_spec.rb +3 -1
  83. data/spec/fortnox/api/mappers/terms_of_payments_spec.rb +16 -0
  84. data/spec/fortnox/api/mappers/unit_spec.rb +57 -0
  85. data/spec/fortnox/api/models/article_spec.rb +2 -0
  86. data/spec/fortnox/api/models/base_spec.rb +46 -38
  87. data/spec/fortnox/api/models/customer_spec.rb +2 -0
  88. data/spec/fortnox/api/models/examples/document_base.rb +5 -3
  89. data/spec/fortnox/api/models/examples/model.rb +12 -9
  90. data/spec/fortnox/api/models/invoice_spec.rb +2 -0
  91. data/spec/fortnox/api/models/order_spec.rb +2 -0
  92. data/spec/fortnox/api/models/project_spec.rb +2 -0
  93. data/spec/fortnox/api/models/terms_of_payments_spec.rb +9 -0
  94. data/spec/fortnox/api/models/unit_spec.rb +31 -0
  95. data/spec/fortnox/api/repositories/article_spec.rb +7 -5
  96. data/spec/fortnox/api/repositories/base_spec.rb +121 -100
  97. data/spec/fortnox/api/repositories/customer_spec.rb +7 -5
  98. data/spec/fortnox/api/repositories/examples/all.rb +5 -4
  99. data/spec/fortnox/api/repositories/examples/find.rb +50 -41
  100. data/spec/fortnox/api/repositories/examples/only.rb +14 -13
  101. data/spec/fortnox/api/repositories/examples/save.rb +23 -29
  102. data/spec/fortnox/api/repositories/examples/save_with_nested_model.rb +11 -11
  103. data/spec/fortnox/api/repositories/examples/save_with_specially_named_attribute.rb +11 -10
  104. data/spec/fortnox/api/repositories/examples/search.rb +15 -15
  105. data/spec/fortnox/api/repositories/invoice_spec.rb +8 -6
  106. data/spec/fortnox/api/repositories/order_spec.rb +8 -6
  107. data/spec/fortnox/api/repositories/project_spec.rb +7 -5
  108. data/spec/fortnox/api/repositories/terms_of_payments_spec.rb +30 -0
  109. data/spec/fortnox/api/repositories/unit_spec.rb +34 -0
  110. data/spec/fortnox/api/types/account_number_spec.rb +12 -9
  111. data/spec/fortnox/api/types/default_delivery_types_spec.rb +6 -4
  112. data/spec/fortnox/api/types/edi_information_spec.rb +9 -7
  113. data/spec/fortnox/api/types/email_information_spec.rb +8 -6
  114. data/spec/fortnox/api/types/email_spec.rb +27 -14
  115. data/spec/fortnox/api/types/enums_spec.rb +3 -1
  116. data/spec/fortnox/api/types/examples/document_row.rb +10 -8
  117. data/spec/fortnox/api/types/examples/enum.rb +29 -22
  118. data/spec/fortnox/api/types/examples/types.rb +8 -4
  119. data/spec/fortnox/api/types/housework_types_spec.rb +68 -0
  120. data/spec/fortnox/api/types/invoice_row_spec.rb +3 -1
  121. data/spec/fortnox/api/types/model_spec.rb +12 -9
  122. data/spec/fortnox/api/types/nullable_spec.rb +8 -6
  123. data/spec/fortnox/api/types/order_row_spec.rb +4 -2
  124. data/spec/fortnox/api/types/required_spec.rb +4 -2
  125. data/spec/fortnox/api/types/sized_spec.rb +18 -16
  126. data/spec/fortnox/api_spec.rb +45 -43
  127. data/spec/spec_helper.rb +9 -6
  128. data/spec/support/helpers.rb +3 -1
  129. data/spec/support/helpers/configuration_helper.rb +2 -0
  130. data/spec/support/helpers/dummy_class_helper.rb +7 -8
  131. data/spec/support/helpers/repository_helper.rb +2 -0
  132. data/spec/support/helpers/when_performing_helper.rb +3 -1
  133. data/spec/support/matchers.rb +2 -0
  134. data/spec/support/matchers/type.rb +3 -1
  135. data/spec/support/matchers/type/attribute_matcher.rb +15 -14
  136. data/spec/support/matchers/type/enum_matcher.rb +9 -7
  137. data/spec/support/matchers/type/have_account_number_matcher.rb +11 -9
  138. data/spec/support/matchers/type/have_country_code_matcher.rb +6 -4
  139. data/spec/support/matchers/type/have_currency_matcher.rb +4 -2
  140. data/spec/support/matchers/type/have_customer_type_matcher.rb +6 -4
  141. data/spec/support/matchers/type/have_default_delivery_type_matcher.rb +4 -2
  142. data/spec/support/matchers/type/have_discount_type_matcher.rb +4 -2
  143. data/spec/support/matchers/type/have_email_matcher.rb +11 -9
  144. data/spec/support/matchers/type/have_housework_type_matcher.rb +9 -0
  145. data/spec/support/matchers/type/have_nullable_date_matcher.rb +29 -29
  146. data/spec/support/matchers/type/have_nullable_matcher.rb +23 -21
  147. data/spec/support/matchers/type/have_nullable_string_matcher.rb +30 -32
  148. data/spec/support/matchers/type/have_sized_float_matcher.rb +4 -2
  149. data/spec/support/matchers/type/have_sized_integer_matcher.rb +4 -2
  150. data/spec/support/matchers/type/have_sized_string_matcher.rb +16 -15
  151. data/spec/support/matchers/type/have_vat_type_matcher.rb +4 -2
  152. data/spec/support/matchers/type/numeric_matcher.rb +25 -23
  153. data/spec/support/matchers/type/require_attribute_matcher.rb +36 -37
  154. data/spec/support/matchers/type/type_matcher.rb +18 -16
  155. data/spec/support/vcr_setup.rb +2 -0
  156. data/spec/vcr_cassettes/orders/{house_work_type_babysitting.yml → housework_type_babysitting.yml} +9 -10
  157. data/spec/vcr_cassettes/orders/{house_work_type_cleaning.yml → housework_type_cleaning.yml} +9 -10
  158. data/spec/vcr_cassettes/orders/{house_work_type_construction.yml → housework_type_construction.yml} +9 -10
  159. data/spec/vcr_cassettes/orders/{house_work_type_cooking.yml → housework_type_cooking.yml} +7 -7
  160. data/spec/vcr_cassettes/orders/{house_work_type_electricity.yml → housework_type_electricity.yml} +9 -10
  161. data/spec/vcr_cassettes/orders/{house_work_type_gardening.yml → housework_type_gardening.yml} +9 -10
  162. data/spec/vcr_cassettes/orders/{house_work_type_glassmetalwork.yml → housework_type_glassmetalwork.yml} +9 -10
  163. data/spec/vcr_cassettes/orders/{house_work_type_grounddrainagework.yml → housework_type_grounddrainagework.yml} +9 -10
  164. data/spec/vcr_cassettes/orders/{house_work_type_hvac.yml → housework_type_hvac.yml} +9 -10
  165. data/spec/vcr_cassettes/orders/{house_work_type_masonry.yml → housework_type_masonry.yml} +9 -10
  166. data/spec/vcr_cassettes/orders/{house_work_type_othercare.yml → housework_type_othercare.yml} +9 -10
  167. data/spec/vcr_cassettes/orders/{house_work_type_othercosts.yml → housework_type_othercosts.yml} +9 -10
  168. data/spec/vcr_cassettes/orders/{house_work_type_paintingwallpapering.yml → housework_type_paintingwallpapering.yml} +9 -10
  169. data/spec/vcr_cassettes/orders/{house_work_type_snowplowing.yml → housework_type_snowplowing.yml} +9 -10
  170. data/spec/vcr_cassettes/orders/{house_work_type_textileclothing.yml → housework_type_textileclothing.yml} +9 -10
  171. data/spec/vcr_cassettes/orders/{house_work_type_tutoring.yml → housework_type_tutoring.yml} +7 -7
  172. data/spec/vcr_cassettes/termsofpayments/all.yml +51 -0
  173. data/spec/vcr_cassettes/termsofpayments/find_failure.yml +45 -0
  174. data/spec/vcr_cassettes/termsofpayments/find_id_1.yml +46 -0
  175. data/spec/vcr_cassettes/termsofpayments/find_new.yml +46 -0
  176. data/spec/vcr_cassettes/termsofpayments/save_new.yml +45 -0
  177. data/spec/vcr_cassettes/termsofpayments/save_old.yml +46 -0
  178. data/spec/vcr_cassettes/units/all.yml +48 -0
  179. data/spec/vcr_cassettes/units/find_failure.yml +45 -0
  180. data/spec/vcr_cassettes/units/find_id_1.yml +46 -0
  181. data/spec/vcr_cassettes/units/find_new.yml +48 -0
  182. data/spec/vcr_cassettes/units/save_new.yml +47 -0
  183. data/spec/vcr_cassettes/units/save_old.yml +48 -0
  184. data/spec/vcr_cassettes/units/save_with_specially_named_attribute.yml +47 -0
  185. metadata +127 -88
  186. data/docs/account.rb +0 -59
  187. data/docs/extraction_script.js +0 -23
  188. data/docs/generation_script.rb +0 -43
  189. data/docs/json/account.json +0 -77
  190. data/lib/fortnox/api/models/document_base.rb +0 -189
  191. data/spec/fortnox/api/types/house_work_types_spec.rb +0 -64
  192. data/spec/support/matchers/type/have_house_work_type_matcher.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 113b527cce0d100ad4761cfa327656b555b51195
4
- data.tar.gz: 2d4208d6e1351af9805648a8b1d23c33fa95525f
3
+ metadata.gz: 6d07b0e9e673df4c4f7d6d9a255fa6bf56bd8bd5
4
+ data.tar.gz: eeb6b7887d3072245757e735e9c58b4133636089
5
5
  SHA512:
6
- metadata.gz: f49abab85ed3a8311f601966976e4f27be08f507c4a66ea849dff5d770d66e25a00fac08d4bf87670dbce71eae5da62f12e0aaf28232ec838f9aebb503742808
7
- data.tar.gz: 47b6e6dad83329cb2d38b1e97531427c72b55cb91ca8ca3c5b175973a8e4db798fc964c3f77c54b6047b24a75c882d1697ac23ac97443e4b8f1b2c224c56d319
6
+ metadata.gz: 2905331dd2962a2805ecce025b23eb66ce7da9425884e7bb2fdc2062eca705b6153a66f3c4bacd31c69f934dc95ea2b2d2eeb7304b26763ed14d244ee11b251f
7
+ data.tar.gz: 7a0b2325ae226069343f0e3b4405a107c7d6d8d32ac6e58dd8b3c1b4d5201b88c84071881a475c7ef60049b4c5c0ad91d3a480a60e0afcfa08e094ec2b955c7e
data/.gitignore CHANGED
@@ -9,3 +9,6 @@ Gemfile.lock
9
9
 
10
10
  # rbenv Ruby version file
11
11
  .ruby-version
12
+
13
+ # Simplecov
14
+ coverage/
data/.rubocop.yml CHANGED
@@ -1,1116 +1,21 @@
1
1
  require: rubocop-rspec
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.2
4
+ TargetRubyVersion: 2.3
5
5
  DisplayCopNames: true
6
6
 
7
- #################### Lint ################################
8
-
9
- Lint/AmbiguousOperator:
10
- Description: >-
11
- Checks for ambiguous operators in the first argument of a
12
- method invocation without parentheses.
13
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
14
- Enabled: true
15
-
16
- Lint/AmbiguousRegexpLiteral:
17
- Description: >-
18
- Checks for ambiguous regexp literals in the first argument of
19
- a method invocation without parenthesis.
20
- Enabled: true
21
-
22
- Lint/AssignmentInCondition:
23
- Description: "Don't use assignment in conditions."
24
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
25
- Enabled: true
26
-
27
- Lint/BlockAlignment:
28
- Description: 'Align block ends correctly.'
29
- Enabled: true
30
-
31
- Lint/CircularArgumentReference:
32
- Description: "Don't refer to the keyword argument in the default value."
33
- Enabled: true
34
-
35
- Lint/ConditionPosition:
36
- Description: >-
37
- Checks for condition placed in a confusing position relative to
38
- the keyword.
39
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
40
- Enabled: true
41
-
42
- Lint/Debugger:
43
- Description: 'Check for debugger calls.'
44
- Enabled: true
45
-
46
- Lint/DefEndAlignment:
47
- Description: 'Align ends corresponding to defs correctly.'
48
- Enabled: true
49
-
50
- Lint/DeprecatedClassMethods:
51
- Description: 'Check for deprecated class method calls.'
52
- Enabled: true
53
-
54
- Lint/DuplicateMethods:
55
- Description: 'Check for duplicate methods calls.'
56
- Enabled: true
57
-
58
- Lint/EachWithObjectArgument:
59
- Description: 'Check for immutable argument given to each_with_object.'
60
- Enabled: true
61
-
62
- Lint/ElseLayout:
63
- Description: 'Check for odd code arrangement in an else block.'
64
- Enabled: true
65
-
66
- Lint/EmptyEnsure:
67
- Description: 'Checks for empty ensure block.'
68
- Enabled: true
69
-
70
- Lint/EmptyInterpolation:
71
- Description: 'Checks for empty string interpolation.'
72
- Enabled: true
73
-
74
- Lint/EndAlignment:
75
- Description: 'Align ends correctly.'
76
- Enabled: true
77
-
78
- Lint/EndInMethod:
79
- Description: 'END blocks should not be placed inside method definitions.'
80
- Enabled: true
81
-
82
- Lint/EnsureReturn:
83
- Description: 'Do not use return in an ensure block.'
84
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
85
- Enabled: true
86
-
87
- Lint/Eval:
88
- Description: 'The use of eval represents a serious security risk.'
89
- Enabled: true
90
-
91
- Lint/FormatParameterMismatch:
92
- Description: 'The number of parameters to format/sprint must match the fields.'
93
- Enabled: true
94
-
95
- Lint/HandleExceptions:
96
- Description: "Don't suppress exception."
97
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
98
- Enabled: true
99
-
100
- Lint/InvalidCharacterLiteral:
101
- Description: >-
102
- Checks for invalid character literals with a non-escaped
103
- whitespace character.
104
- Enabled: true
105
-
106
- Lint/LiteralInCondition:
107
- Description: 'Checks of literals used in conditions.'
108
- Enabled: true
109
-
110
- Lint/LiteralInInterpolation:
111
- Description: 'Checks for literals used in interpolation.'
112
- Enabled: true
113
-
114
- Lint/Loop:
115
- Description: >-
116
- Use Kernel#loop with break rather than begin/end/until or
117
- begin/end/while for post-loop tests.
118
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
119
- Enabled: true
120
-
121
- Lint/NestedMethodDefinition:
122
- Description: 'Do not use nested method definitions.'
123
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
124
- Enabled: true
125
-
126
- Lint/NonLocalExitFromIterator:
127
- Description: 'Do not use return in iterator to cause non-local exit.'
128
- Enabled: true
129
-
130
- Lint/ParenthesesAsGroupedExpression:
131
- Description: >-
132
- Checks for method calls with a space before the opening
133
- parenthesis.
134
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
135
- Enabled: true
136
-
137
- Lint/RequireParentheses:
138
- Description: >-
139
- Use parentheses in the method call to avoid confusion
140
- about precedence.
141
- Enabled: true
142
-
143
- Lint/RescueException:
144
- Description: 'Avoid rescuing the Exception class.'
145
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
146
- Enabled: true
147
-
148
- Lint/ShadowingOuterLocalVariable:
149
- Description: >-
150
- Do not use the same name as outer local variable
151
- for block arguments or block local variables.
152
- Enabled: true
153
-
154
- Lint/StringConversionInInterpolation:
155
- Description: 'Checks for Object#to_s usage in string interpolation.'
156
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
157
- Enabled: true
158
-
159
- Lint/UnderscorePrefixedVariableName:
160
- Description: 'Do not use prefix `_` for a variable that is used.'
161
- Enabled: true
162
-
163
- Lint/UnneededDisable:
164
- Description: >-
165
- Checks for rubocop:disable comments that can be removed.
166
- Note: this cop is not disabled when disabling all cops.
167
- It must be explicitly disabled.
168
- Enabled: true
169
-
170
- Lint/UnusedBlockArgument:
171
- Description: 'Checks for unused block arguments.'
172
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
173
- Enabled: true
174
-
175
- Lint/UnusedMethodArgument:
176
- Description: 'Checks for unused method arguments.'
177
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
178
- Enabled: true
179
-
180
- Lint/UnreachableCode:
181
- Description: 'Unreachable code.'
182
- Enabled: true
183
-
184
- Lint/UselessAccessModifier:
185
- Description: 'Checks for useless access modifiers.'
186
- Enabled: true
187
-
188
- Lint/UselessAssignment:
189
- Description: 'Checks for useless assignment to a local variable.'
190
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
191
- Enabled: true
192
-
193
- Lint/UselessComparison:
194
- Description: 'Checks for comparison of something with itself.'
195
- Enabled: true
196
-
197
- Lint/UselessElseWithoutRescue:
198
- Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
199
- Enabled: true
200
-
201
- Lint/UselessSetterCall:
202
- Description: 'Checks for useless setter call to a local variable.'
203
- Enabled: true
204
-
205
- Lint/Void:
206
- Description: 'Possible use of operator/literal/variable in void context.'
207
- Enabled: true
208
-
209
- ###################### Metrics ####################################
210
-
211
- Metrics/AbcSize:
212
- Description: >-
213
- A calculated magnitude based on number of assignments,
214
- branches, and conditions.
215
- Reference: 'http://c2.com/cgi/wiki?AbcMetric'
7
+ RSpec/FilePath:
216
8
  Enabled: false
217
- Max: 20
218
9
 
219
- Metrics/BlockNesting:
220
- Description: 'Avoid excessive block nesting'
221
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
222
- Enabled: true
10
+ RSpec/NestedGroups:
223
11
  Max: 4
224
12
 
225
- Metrics/ClassLength:
226
- Description: 'Avoid classes longer than 250 lines of code.'
227
- Enabled: true
228
- Max: 250
229
-
230
- Metrics/CyclomaticComplexity:
231
- Description: >-
232
- A complexity metric that is strongly correlated to the number
233
- of test cases needed to validate a method.
234
- Enabled: true
235
-
236
- Metrics/LineLength:
237
- Description: 'Limit lines to 80 characters.'
238
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
239
- Enabled: false
240
-
241
- Metrics/MethodLength:
242
- Description: 'Avoid methods longer than 30 lines of code.'
243
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
244
- Enabled: true
245
- Max: 30
246
-
247
- Metrics/ModuleLength:
248
- Description: 'Avoid modules longer than 250 lines of code.'
249
- Enabled: true
250
- Max: 250
251
-
252
- Metrics/ParameterLists:
253
- Description: 'Avoid parameter lists longer than three or four parameters.'
254
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
255
- Enabled: true
256
-
257
- Metrics/PerceivedComplexity:
258
- Description: >-
259
- A complexity metric geared towards measuring complexity for a
260
- human reader.
261
- Enabled: false
262
-
263
- ##################### Performance #############################
264
-
265
- Performance/Count:
266
- Description: >-
267
- Use `count` instead of `select...size`, `reject...size`,
268
- `select...count`, `reject...count`, `select...length`,
269
- and `reject...length`.
270
- Enabled: true
271
-
272
- Performance/Detect:
273
- Description: >-
274
- Use `detect` instead of `select.first`, `find_all.first`,
275
- `select.last`, and `find_all.last`.
276
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
277
- Enabled: true
278
-
279
- Performance/FlatMap:
280
- Description: >-
281
- Use `Enumerable#flat_map`
282
- instead of `Enumerable#map...Array#flatten(1)`
283
- or `Enumberable#collect..Array#flatten(1)`
284
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
285
- Enabled: true
286
- EnabledForFlattenWithoutParams: false
287
- # If enabled, this cop will warn about usages of
288
- # `flatten` being called without any parameters.
289
- # This can be dangerous since `flat_map` will only flatten 1 level, and
290
- # `flatten` without any parameters can flatten multiple levels.
291
-
292
- Performance/ReverseEach:
293
- Description: 'Use `reverse_each` instead of `reverse.each`.'
294
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
295
- Enabled: true
296
-
297
- Performance/Sample:
298
- Description: >-
299
- Use `sample` instead of `shuffle.first`,
300
- `shuffle.last`, and `shuffle[Fixnum]`.
301
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
302
- Enabled: true
303
-
304
- Performance/Size:
305
- Description: >-
306
- Use `size` instead of `count` for counting
307
- the number of elements in `Array` and `Hash`.
308
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
309
- Enabled: true
310
-
311
- Performance/StringReplacement:
312
- Description: >-
313
- Use `tr` instead of `gsub` when you are replacing the same
314
- number of characters. Use `delete` instead of `gsub` when
315
- you are deleting characters.
316
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
317
- Enabled: true
318
-
319
- ################## Style #################################
320
-
321
- Style/AccessModifierIndentation:
322
- Description: Check indentation of private/protected visibility modifiers.
323
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
324
- Enabled: false
325
-
326
- Style/AccessorMethodName:
327
- Description: Check the naming of accessor methods for get_/set_.
328
- Enabled: false
329
-
330
- Style/Alias:
331
- Description: 'Use alias_method instead of alias.'
332
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
333
- Enabled: false
334
-
335
- Style/AlignArray:
336
- Description: >-
337
- Align the elements of an array literal if they span more than
338
- one line.
339
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
340
- Enabled: false
341
-
342
- Style/AlignHash:
343
- Description: >-
344
- Align the elements of a hash literal if they span more than
345
- one line.
346
- Enabled: false
347
-
348
- Style/AlignParameters:
349
- Description: >-
350
- Align the parameters of a method call if they span more
351
- than one line.
352
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
353
- Enabled: false
354
-
355
- Style/AndOr:
356
- Description: 'Use &&/|| instead of and/or.'
357
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
358
- Enabled: false
359
-
360
- Style/ArrayJoin:
361
- Description: 'Use Array#join instead of Array#*.'
362
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
363
- Enabled: false
364
-
365
- Style/AsciiComments:
366
- Description: 'Use only ascii symbols in comments.'
367
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
368
- Enabled: false
369
-
370
- Style/AsciiIdentifiers:
371
- Description: 'Use only ascii symbols in identifiers.'
372
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
373
- Enabled: false
374
-
375
- Style/Attr:
376
- Description: 'Checks for uses of Module#attr.'
377
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
378
- Enabled: false
379
-
380
- Style/BeginBlock:
381
- Description: 'Avoid the use of BEGIN blocks.'
382
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
383
- Enabled: false
384
-
385
- Style/BarePercentLiterals:
386
- Description: 'Checks if usage of %() or %Q() matches configuration.'
387
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
388
- Enabled: false
389
-
390
- Style/BlockComments:
391
- Description: 'Do not use block comments.'
392
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
393
- Enabled: false
394
-
395
- Style/BlockEndNewline:
396
- Description: 'Put end statement of multiline block on its own line.'
397
- Enabled: false
398
-
399
- Style/BlockDelimiters:
400
- Description: >-
401
- Avoid using {...} for multi-line blocks (multiline chaining is
402
- always ugly).
403
- Prefer {...} over do...end for single-line blocks.
404
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
405
- Enabled: false
406
-
407
- Style/BracesAroundHashParameters:
408
- Description: 'Enforce braces style around hash parameters.'
409
- Enabled: false
410
-
411
- Style/CaseEquality:
412
- Description: 'Avoid explicit use of the case equality operator(===).'
413
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
414
- Enabled: false
415
-
416
- Style/CaseIndentation:
417
- Description: 'Indentation of when in a case/when/[else/]end.'
418
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
419
- Enabled: false
420
-
421
- Style/CharacterLiteral:
422
- Description: 'Checks for uses of character literals.'
423
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
424
- Enabled: false
425
-
426
- Style/ClassAndModuleCamelCase:
427
- Description: 'Use CamelCase for classes and modules.'
428
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
429
- Enabled: false
430
-
431
- Style/ClassAndModuleChildren:
432
- Description: 'Checks style of children classes and modules.'
433
- Enabled: false
434
-
435
- Style/ClassCheck:
436
- Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
437
- Enabled: false
438
-
439
- Style/ClassMethods:
440
- Description: 'Use self when defining module/class methods.'
441
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
442
- Enabled: false
443
-
444
- Style/ClassVars:
445
- Description: 'Avoid the use of class variables.'
446
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
447
- Enabled: false
448
-
449
- Style/ClosingParenthesisIndentation:
450
- Description: 'Checks the indentation of hanging closing parentheses.'
451
- Enabled: false
452
-
453
- Style/ColonMethodCall:
454
- Description: 'Do not use :: for method call.'
455
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
456
- Enabled: false
457
-
458
- Style/CommandLiteral:
459
- Description: 'Use `` or %x around command literals.'
460
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
461
- Enabled: false
462
-
463
- Style/CommentAnnotation:
464
- Description: >-
465
- Checks formatting of special comments
466
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
467
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
468
- Enabled: false
469
-
470
- Style/CommentIndentation:
471
- Description: 'Indentation of comments.'
472
- Enabled: false
473
-
474
- Style/ConstantName:
475
- Description: 'Constants should use SCREAMING_SNAKE_CASE.'
476
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
477
- Enabled: false
478
-
479
- Style/DefWithParentheses:
480
- Description: 'Use def with parentheses when there are arguments.'
481
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
482
- Enabled: false
483
-
484
13
  Style/Documentation:
485
- Description: 'Document classes and non-namespace modules.'
486
- Enabled: false
487
-
488
- Style/DotPosition:
489
- Description: 'Checks the position of the dot in multi-line method calls.'
490
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
491
- Enabled: false
492
-
493
- Style/DoubleNegation:
494
- Description: 'Checks for uses of double negation (!!).'
495
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
496
- Enabled: false
497
-
498
- Style/EachWithObject:
499
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
500
- Enabled: false
501
-
502
- Style/ElseAlignment:
503
- Description: 'Align elses and elsifs correctly.'
504
- Enabled: false
505
-
506
- Style/EmptyElse:
507
- Description: 'Avoid empty else-clauses.'
508
- Enabled: false
509
-
510
- Style/EmptyLineBetweenDefs:
511
- Description: 'Use empty lines between defs.'
512
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
513
- Enabled: false
514
-
515
- Style/EmptyLines:
516
- Description: "Don't use several empty lines in a row."
517
- Enabled: false
518
-
519
- Style/EmptyLinesAroundAccessModifier:
520
- Description: "Keep blank lines around access modifiers."
521
- Enabled: false
522
-
523
- Style/EmptyLinesAroundBlockBody:
524
- Description: "Keeps track of empty lines around block bodies."
525
- Enabled: false
526
-
527
- Style/EmptyLinesAroundClassBody:
528
- Description: "Keeps track of empty lines around class bodies."
529
- Enabled: false
530
-
531
- Style/EmptyLinesAroundModuleBody:
532
- Description: "Keeps track of empty lines around module bodies."
533
- Enabled: false
534
-
535
- Style/EmptyLinesAroundMethodBody:
536
- Description: "Keeps track of empty lines around method bodies."
537
- Enabled: false
538
-
539
- Style/EmptyLiteral:
540
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
541
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
542
- Enabled: false
543
-
544
- Style/EndBlock:
545
- Description: 'Avoid the use of END blocks.'
546
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
547
- Enabled: false
548
-
549
- Style/EndOfLine:
550
- Description: 'Use Unix-style line endings.'
551
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
552
- Enabled: false
553
-
554
- Style/EvenOdd:
555
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
556
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
557
- Enabled: false
558
-
559
- Style/ExtraSpacing:
560
- Description: 'Do not use unnecessary spacing.'
561
- Enabled: false
562
-
563
- Style/FileName:
564
- Description: 'Use snake_case for source file names.'
565
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
566
- Enabled: false
567
-
568
- Style/InitialIndentation:
569
- Description: >-
570
- Checks the indentation of the first non-blank non-comment line in a file.
571
- Enabled: false
572
-
573
- Style/FirstParameterIndentation:
574
- Description: 'Checks the indentation of the first parameter in a method call.'
575
- Enabled: false
576
-
577
- Style/FlipFlop:
578
- Description: 'Checks for flip flops'
579
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
580
- Enabled: false
581
-
582
- Style/For:
583
- Description: 'Checks use of for or each in multiline loops.'
584
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
585
- Enabled: false
586
-
587
- Style/FormatString:
588
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
589
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
590
- Enabled: false
591
-
592
- Style/GlobalVars:
593
- Description: 'Do not introduce global variables.'
594
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
595
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
596
- Enabled: false
597
-
598
- Style/GuardClause:
599
- Description: 'Check for conditionals that can be replaced with guard clauses'
600
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
601
- Enabled: false
602
-
603
- Style/HashSyntax:
604
- Description: >-
605
- Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
606
- { :a => 1, :b => 2 }.
607
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
608
- Enabled: false
609
-
610
- Style/IfUnlessModifier:
611
- Description: >-
612
- Favor modifier if/unless usage when you have a
613
- single-line body.
614
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
615
- Enabled: false
616
-
617
- Style/IfWithSemicolon:
618
- Description: 'Do not use if x; .... Use the ternary operator instead.'
619
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
620
- Enabled: false
621
-
622
- Style/IndentationConsistency:
623
- Description: 'Keep indentation straight.'
624
- Enabled: false
625
-
626
- Style/IndentationWidth:
627
- Description: 'Use 2 spaces for indentation.'
628
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
629
- Enabled: false
630
-
631
- Style/IndentArray:
632
- Description: >-
633
- Checks the indentation of the first element in an array
634
- literal.
635
- Enabled: false
636
-
637
- Style/IndentHash:
638
- Description: 'Checks the indentation of the first key in a hash literal.'
639
- Enabled: false
640
-
641
- Style/InfiniteLoop:
642
- Description: 'Use Kernel#loop for infinite loops.'
643
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
644
- Enabled: false
645
-
646
- Style/Lambda:
647
- Description: 'Use the new lambda literal syntax for single-line blocks.'
648
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
649
- Enabled: false
650
-
651
- Style/LambdaCall:
652
- Description: 'Use lambda.call(...) instead of lambda.(...).'
653
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
654
- Enabled: false
655
-
656
- Style/LeadingCommentSpace:
657
- Description: 'Comments should start with a space.'
658
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
659
- Enabled: false
660
-
661
- Style/LineEndConcatenation:
662
- Description: >-
663
- Use \ instead of + or << to concatenate two string literals at
664
- line end.
665
- Enabled: false
666
-
667
- Style/MethodCallParentheses:
668
- Description: 'Do not use parentheses for method calls with no arguments.'
669
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
670
- Enabled: false
671
-
672
- Style/MethodDefParentheses:
673
- Description: >-
674
- Checks if the method definitions have or don't have
675
- parentheses.
676
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
677
- Enabled: false
678
-
679
- Style/MethodName:
680
- Description: 'Use the configured style when naming methods.'
681
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
682
- Enabled: false
683
-
684
- Style/ModuleFunction:
685
- Description: 'Checks for usage of `extend self` in modules.'
686
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
687
- Enabled: false
688
-
689
- Style/MultilineBlockChain:
690
- Description: 'Avoid multi-line chains of blocks.'
691
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
692
- Enabled: false
693
-
694
- Style/MultilineBlockLayout:
695
- Description: 'Ensures newlines after multiline block do statements.'
696
- Enabled: false
697
-
698
- Style/MultilineIfThen:
699
- Description: 'Do not use then for multi-line if/unless.'
700
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
701
- Enabled: false
702
-
703
- Style/MultilineOperationIndentation:
704
- Description: >-
705
- Checks indentation of binary operations that span more than
706
- one line.
707
- Enabled: false
708
-
709
- Style/MultilineTernaryOperator:
710
- Description: >-
711
- Avoid multi-line ?: (the ternary operator);
712
- use if/unless instead.
713
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
714
- Enabled: false
715
-
716
- Style/NegatedIf:
717
- Description: >-
718
- Favor unless over if for negative conditions
719
- (or control flow or).
720
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
721
- Enabled: false
722
-
723
- Style/NegatedWhile:
724
- Description: 'Favor until over while for negative conditions.'
725
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
726
- Enabled: false
727
-
728
- Style/NestedTernaryOperator:
729
- Description: 'Use one expression per branch in a ternary operator.'
730
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
731
- Enabled: false
732
-
733
- Style/Next:
734
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
735
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
736
- Enabled: false
737
-
738
- Style/NilComparison:
739
- Description: 'Prefer x.nil? to x == nil.'
740
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
741
- Enabled: false
742
-
743
- Style/NonNilCheck:
744
- Description: 'Checks for redundant nil checks.'
745
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
746
- Enabled: false
747
-
748
- Style/Not:
749
- Description: 'Use ! instead of not.'
750
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
751
- Enabled: false
752
-
753
- Style/NumericLiterals:
754
- Description: >-
755
- Add underscores to large numeric literals to improve their
756
- readability.
757
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
758
- Enabled: false
759
-
760
- Style/OneLineConditional:
761
- Description: >-
762
- Favor the ternary operator(?:) over
763
- if/then/else/end constructs.
764
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
765
- Enabled: false
766
-
767
- Style/OpMethod:
768
- Description: 'When defining binary operators, name the argument other.'
769
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
770
- Enabled: false
771
-
772
- Style/OptionalArguments:
773
- Description: >-
774
- Checks for optional arguments that do not appear at the end
775
- of the argument list
776
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
777
- Enabled: false
778
-
779
- Style/ParenthesesAroundCondition:
780
- Description: >-
781
- Don't use parentheses around the condition of an
782
- if/unless/while.
783
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
784
- Enabled: false
785
-
786
- Style/PercentLiteralDelimiters:
787
- Description: 'Use `%`-literal delimiters consistently'
788
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
789
- Enabled: false
790
-
791
- Style/PercentQLiterals:
792
- Description: 'Checks if uses of %Q/%q match the configured preference.'
793
- Enabled: false
794
-
795
- Style/PerlBackrefs:
796
- Description: 'Avoid Perl-style regex back references.'
797
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
798
- Enabled: false
799
-
800
- Style/PredicateName:
801
- Description: 'Check the names of predicate methods.'
802
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
803
- Enabled: false
804
-
805
- Style/PreferredHashMethods:
806
- Description: 'Checks for use of deprecated Hash methods.'
807
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
808
- Enabled: false
809
-
810
- Style/Proc:
811
- Description: 'Use proc instead of Proc.new.'
812
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
813
- Enabled: false
814
-
815
- Style/RaiseArgs:
816
- Description: 'Checks the arguments passed to raise/fail.'
817
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
818
- Enabled: false
819
-
820
- Style/RedundantBegin:
821
- Description: "Don't use begin blocks when they are not needed."
822
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
823
- Enabled: false
824
-
825
- Style/RedundantException:
826
- Description: "Checks for an obsolete RuntimeException argument in raise/fail."
827
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
828
- Enabled: false
829
-
830
- Style/RedundantReturn:
831
- Description: "Don't use return where it's not required."
832
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
833
- Enabled: false
834
-
835
- Style/RedundantSelf:
836
- Description: "Don't use self where it's not needed."
837
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
838
- Enabled: false
839
-
840
- Style/RegexpLiteral:
841
- Description: 'Use / or %r around regular expressions.'
842
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
843
- Enabled: false
844
-
845
- Style/RescueEnsureAlignment:
846
- Description: 'Align rescues and ensures correctly.'
847
- Enabled: false
848
-
849
- Style/RescueModifier:
850
- Description: 'Avoid using rescue in its modifier form.'
851
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
852
- Enabled: false
853
-
854
- Style/SelfAssignment:
855
- Description: >-
856
- Checks for places where self-assignment shorthand should have
857
- been used.
858
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
859
- Enabled: false
860
-
861
- Style/Semicolon:
862
- Description: "Don't use semicolons to terminate expressions."
863
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
864
- Enabled: false
865
-
866
- Style/SignalException:
867
- Description: 'Checks for proper usage of fail and raise.'
868
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
869
- Enabled: false
870
-
871
- Style/SingleLineBlockParams:
872
- Description: 'Enforces the names of some block params.'
873
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
874
- Enabled: false
875
-
876
- Style/SingleLineMethods:
877
- Description: 'Avoid single-line methods.'
878
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
879
- Enabled: false
880
-
881
- Style/SpaceAfterColon:
882
- Description: 'Use spaces after colons.'
883
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
884
- Enabled: false
885
-
886
- Style/SpaceAfterComma:
887
- Description: 'Use spaces after commas.'
888
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
889
- Enabled: false
890
-
891
- Style/SpaceAfterMethodName:
892
- Description: >-
893
- Do not put a space between a method name and the opening
894
- parenthesis in a method definition.
895
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
896
- Enabled: false
897
-
898
- Style/SpaceAfterNot:
899
- Description: Tracks redundant space after the ! operator.
900
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
901
- Enabled: false
902
-
903
- Style/SpaceAfterSemicolon:
904
- Description: 'Use spaces after semicolons.'
905
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
906
- Enabled: false
907
-
908
- Style/SpaceBeforeBlockBraces:
909
- Description: >-
910
- Checks that the left block brace has or doesn't have space
911
- before it.
912
- EnforcedStyle: no_space
913
- Enabled: true
914
-
915
- Style/SpaceBeforeComma:
916
- Description: 'No spaces before commas.'
917
- Enabled: false
918
-
919
- Style/SpaceBeforeComment:
920
- Description: >-
921
- Checks for missing space between code and a comment on the
922
- same line.
923
- Enabled: false
924
-
925
- Style/SpaceBeforeSemicolon:
926
- Description: 'No spaces before semicolons.'
927
- Enabled: false
928
-
929
- Style/SpaceBeforeFirstArg:
930
- Description: >-
931
- Put a space between a method name and the first argument
932
- in a method call without parentheses.
933
- Enabled: true
934
-
935
- Style/SpaceInsideBlockBraces:
936
- Description: >-
937
- Checks that block braces have or don't have surrounding space.
938
- For blocks taking parameters, checks that the left brace has
939
- or doesn't have trailing space.
940
- EnforcedStyle: space
941
- EnforcedStyleForEmptyBraces: no_space
942
- SpaceBeforeBlockParameters: true
943
- Enabled: true
944
-
945
- Style/SpaceAroundBlockParameters:
946
- Description: 'Checks the spacing inside and after block parameters pipes.'
947
- EnforcedStyleInsidePipes: no_space
948
- Enabled: true
949
-
950
- Style/SpaceAroundEqualsInParameterDefault:
951
- Description: >-
952
- Checks that the equals signs in parameter default assignments
953
- have or don't have surrounding space depending on
954
- configuration.
955
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
956
- EnforcedStyle: space
957
- Enabled: true
958
-
959
- Style/SpaceAroundOperators:
960
- Description: 'Use a single space around operators.'
961
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
962
- AllowForAlignment: true
963
- Enabled: true
964
-
965
- Style/SpaceAroundKeyword:
966
- Description: 'Put a space before the modifier keyword.'
967
- Enabled: false
968
-
969
- Style/SpaceInsideBrackets:
970
- Description: 'No spaces after [ or before ].'
971
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
972
- Enabled: false
973
-
974
- Style/SpaceInsideHashLiteralBraces:
975
- Description: "Use spaces inside hash literal braces - or don't."
976
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
977
- EnforcedStyle: space
978
- EnforcedStyleForEmptyBraces: no_space
979
- Enabled: true
980
-
981
- Style/SpaceInsideParens:
982
- Description: 'Require spaces after ( or before ).'
983
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
984
- Enabled: false
985
-
986
- Style/SpaceInsideRangeLiteral:
987
- Description: 'No spaces inside range literals.'
988
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
989
- Enabled: false
990
-
991
- Style/SpaceInsideStringInterpolation:
992
- Description: 'This cop checks for whitespace within string interpolations.'
993
- EnforcedStyle: space
994
- Enabled: true
995
-
996
- Style/SpecialGlobalVars:
997
- Description: 'Avoid Perl-style global variables.'
998
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
999
- Enabled: false
1000
-
1001
- Style/StringLiterals:
1002
- Description: 'Checks if uses of quotes match the configured preference.'
1003
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
1004
- Enabled: false
1005
-
1006
- Style/StringLiteralsInInterpolation:
1007
- Description: >-
1008
- Checks if uses of quotes inside expressions in interpolated
1009
- strings match the configured preference.
1010
- Enabled: false
1011
-
1012
- Style/StructInheritance:
1013
- Description: 'Checks for inheritance from Struct.new.'
1014
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
1015
- Enabled: false
1016
-
1017
- Style/SymbolLiteral:
1018
- Description: 'Use plain symbols instead of string symbols when possible.'
1019
- Enabled: false
1020
-
1021
- Style/SymbolProc:
1022
- Description: 'Use symbols as procs instead of blocks when possible.'
1023
- Enabled: false
1024
-
1025
- Style/Tab:
1026
- Description: 'No hard tabs.'
1027
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
1028
- Enabled: false
1029
-
1030
- Style/TrailingBlankLines:
1031
- Description: 'Checks trailing blank lines and final newline.'
1032
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
1033
- Enabled: false
1034
-
1035
- Style/TrailingCommaInLiteral:
1036
- Description: 'Checks for trailing comma in parameter literals.'
1037
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
1038
- Enabled: false
1039
-
1040
- Style/TrailingCommaInArguments:
1041
- Description: 'Checks for trailing comma in parameter lists.'
1042
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
1043
- Enabled: false
1044
-
1045
- Style/TrailingWhitespace:
1046
- Description: 'Avoid trailing whitespace.'
1047
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
1048
- Enabled: false
1049
-
1050
- Style/TrivialAccessors:
1051
- Description: 'Prefer attr_* methods to trivial readers/writers.'
1052
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
1053
- Enabled: false
1054
-
1055
- Style/UnlessElse:
1056
- Description: >-
1057
- Do not use unless with else. Rewrite these with the positive
1058
- case first.
1059
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
1060
- Enabled: false
1061
-
1062
- Style/UnneededCapitalW:
1063
- Description: 'Checks for %W when interpolation is not needed.'
1064
- Enabled: false
1065
-
1066
- Style/UnneededPercentQ:
1067
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
1068
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
1069
- Enabled: false
1070
-
1071
- Style/TrailingUnderscoreVariable:
1072
- Description: >-
1073
- Checks for the usage of unneeded trailing underscores at the
1074
- end of parallel variable assignment.
1075
- Enabled: false
1076
-
1077
- Style/VariableInterpolation:
1078
- Description: >-
1079
- Don't interpolate global, instance and class variables
1080
- directly in strings.
1081
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
1082
- Enabled: false
1083
-
1084
- Style/VariableName:
1085
- Description: 'Use the configured style when naming variables.'
1086
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
1087
- Enabled: false
1088
-
1089
- Style/WhenThen:
1090
- Description: 'Use when x then ... for one-line cases.'
1091
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
1092
- Enabled: false
1093
-
1094
- Style/WhileUntilDo:
1095
- Description: 'Checks for redundant do after while or until.'
1096
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
1097
- Enabled: false
1098
-
1099
- Style/WhileUntilModifier:
1100
- Description: >-
1101
- Favor modifier while/until usage when you have a
1102
- single-line body.
1103
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
1104
- Enabled: false
1105
-
1106
- Style/WordArray:
1107
- Description: 'Use %w or %W for arrays of words.'
1108
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
1109
- Enabled: false
1110
-
1111
- #################### RSpec ################################
1112
- RSpec/FilePath:
1113
14
  Enabled: false
15
+
16
+ Metrics/LineLength:
17
+ Max: 120
1114
18
 
1115
- RSpec/NestedGroups:
1116
- MaxNesting: 4
19
+ Metrics/BlockLength:
20
+ Exclude:
21
+ - 'spec/**/*'