trackler 1.0.0 → 1.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -0
  3. data/CHANGELOG.md +9 -1
  4. data/README.md +10 -0
  5. data/common/CONTRIBUTING.md +50 -2
  6. data/common/exercises/alphametics/canonical-data.json +10 -10
  7. data/common/exercises/markdown/canonical-data.json +4 -4
  8. data/common/exercises/pov/canonical-data.json +356 -0
  9. data/lib/trackler/version.rb +1 -1
  10. data/trackler.gemspec +1 -2
  11. data/tracks/c/config.json +11 -1
  12. data/tracks/c/exercises/binary-search/makefile +16 -0
  13. data/tracks/c/exercises/binary-search/src/example.c +21 -0
  14. data/tracks/c/exercises/binary-search/src/example.h +8 -0
  15. data/tracks/c/exercises/binary-search/test/test_binary_search.c +99 -0
  16. data/tracks/c/exercises/binary-search/test/vendor/unity.c +1300 -0
  17. data/tracks/c/exercises/binary-search/test/vendor/unity.h +274 -0
  18. data/tracks/c/exercises/binary-search/test/vendor/unity_internals.h +701 -0
  19. data/tracks/clojure/config.json +3 -2
  20. data/tracks/clojure/exercises/bank-account/project.clj +4 -0
  21. data/tracks/clojure/exercises/bank-account/src/example.clj +17 -0
  22. data/tracks/clojure/exercises/bank-account/test/bank_account_test.clj +44 -0
  23. data/tracks/clojure/exercises/isogram/project.clj +4 -0
  24. data/tracks/clojure/exercises/isogram/src/example.clj +5 -0
  25. data/tracks/clojure/exercises/isogram/test/isogram_test.clj +17 -0
  26. data/tracks/csharp/config.json +27 -87
  27. data/tracks/csharp/exercises/exercises.csproj +265 -1
  28. data/tracks/csharp/exercises/grep/Example.cs +114 -0
  29. data/tracks/csharp/exercises/grep/GrepTest.cs +376 -0
  30. data/tracks/csharp/exercises/paket.references +2 -1
  31. data/tracks/csharp/exercises/poker/Example.cs +96 -0
  32. data/tracks/csharp/exercises/poker/PokerTest.cs +171 -0
  33. data/tracks/csharp/exercises/sgf-parsing/Example.cs +61 -0
  34. data/tracks/csharp/exercises/sgf-parsing/SgfParsing.cs +13 -0
  35. data/tracks/csharp/exercises/sgf-parsing/SgfParsingTest.cs +158 -0
  36. data/tracks/csharp/paket.dependencies +2 -1
  37. data/tracks/csharp/paket.lock +72 -0
  38. data/tracks/ecmascript/exercises/simple-cipher/simple-cipher.spec.js +1 -1
  39. data/tracks/elisp/config.json +6 -1
  40. data/tracks/elisp/exercises/etl/etl-test.el +90 -0
  41. data/tracks/elisp/exercises/etl/etl.el +9 -0
  42. data/tracks/elisp/exercises/etl/example.el +22 -0
  43. data/tracks/elisp/exercises/nucleotide-count/example.el +19 -0
  44. data/tracks/elisp/exercises/nucleotide-count/nucleotide-count-test.el +34 -0
  45. data/tracks/elisp/exercises/nucleotide-count/nucleotide-count.el +9 -0
  46. data/tracks/elisp/exercises/perfect-numbers/example.el +28 -0
  47. data/tracks/elisp/exercises/perfect-numbers/perfect-numbers-test.el +24 -0
  48. data/tracks/elisp/exercises/perfect-numbers/perfect-numbers.el +10 -0
  49. data/tracks/elisp/exercises/roman-numerals/example.el +36 -0
  50. data/tracks/elisp/exercises/roman-numerals/roman-numerals-test.el +30 -0
  51. data/tracks/elisp/exercises/roman-numerals/roman-numerals.el +10 -0
  52. data/tracks/elisp/exercises/word-count/example.el +18 -0
  53. data/tracks/elisp/exercises/word-count/word-count-test.el +64 -0
  54. data/tracks/elisp/exercises/word-count/word-count.el +9 -0
  55. data/tracks/elixir/README.md +4 -4
  56. data/tracks/elixir/SETUP.md +3 -3
  57. data/tracks/elixir/docs/TESTS.md +3 -3
  58. data/tracks/elixir/exercises/accumulate/accumulate_test.exs +7 -7
  59. data/tracks/elixir/exercises/acronym/acronym_test.exs +5 -5
  60. data/tracks/elixir/exercises/allergies/allergies_test.exs +13 -13
  61. data/tracks/elixir/exercises/anagram/anagram_test.exs +12 -12
  62. data/tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs +9 -9
  63. data/tracks/elixir/exercises/bank-account/bank_account_test.exs +5 -5
  64. data/tracks/elixir/exercises/beer-song/beer_song_test.exs +6 -6
  65. data/tracks/elixir/exercises/binary-search/binary_search_test.exs +7 -7
  66. data/tracks/elixir/exercises/binary/binary_test.exs +13 -13
  67. data/tracks/elixir/exercises/bob/bob_test.exs +15 -15
  68. data/tracks/elixir/exercises/bowling/bowling_test.exs +18 -18
  69. data/tracks/elixir/exercises/bracket-push/bracket_push_test.exs +12 -12
  70. data/tracks/elixir/exercises/change/change_test.exs +7 -7
  71. data/tracks/elixir/exercises/connect/connect_test.exs +9 -9
  72. data/tracks/elixir/exercises/crypto-square/crypto_square_test.exs +7 -7
  73. data/tracks/elixir/exercises/custom-set/custom_set_test.exs +11 -11
  74. data/tracks/elixir/exercises/diamond/diamond_test.exs +4 -4
  75. data/tracks/elixir/exercises/difference-of-squares/difference_of_squares_test.exs +10 -10
  76. data/tracks/elixir/exercises/dot-dsl/dot_dsl_test.exs +17 -17
  77. data/tracks/elixir/exercises/etl/etl_test.exs +5 -5
  78. data/tracks/elixir/exercises/flatten-array/flatten_array_test.exs +6 -6
  79. data/tracks/elixir/exercises/forth/forth_test.exs +16 -16
  80. data/tracks/elixir/exercises/gigasecond/gigasecond_test.exs +5 -5
  81. data/tracks/elixir/exercises/grade-school/grade_school_test.exs +6 -6
  82. data/tracks/elixir/exercises/grains/grains_test.exs +9 -9
  83. data/tracks/elixir/exercises/hamming/hamming_test.exs +6 -6
  84. data/tracks/elixir/exercises/hello-world/hello_world_test.exs +3 -3
  85. data/tracks/elixir/exercises/hexadecimal/hexadecimal_test.exs +11 -11
  86. data/tracks/elixir/exercises/isogram/isogram_test.exs +10 -10
  87. data/tracks/elixir/exercises/kindergarten-garden/garden_test.exs +7 -7
  88. data/tracks/elixir/exercises/largest-series-product/largest_series_product_test.exs +17 -17
  89. data/tracks/elixir/exercises/leap/leap_test.exs +5 -5
  90. data/tracks/elixir/exercises/list-ops/list_ops_test.exs +26 -26
  91. data/tracks/elixir/exercises/luhn/luhn_test.exs +7 -7
  92. data/tracks/elixir/exercises/markdown/markdown_test.exs +10 -10
  93. data/tracks/elixir/exercises/meetup/meetup_test.exs +92 -92
  94. data/tracks/elixir/exercises/minesweeper/minesweeper_test.exs +8 -8
  95. data/tracks/elixir/exercises/nth-prime/nth_prime_test.exs +6 -6
  96. data/tracks/elixir/exercises/nucleotide-count/example.exs +0 -5
  97. data/tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs +7 -7
  98. data/tracks/elixir/exercises/palindrome-products/palindrome_products_test.exs +6 -6
  99. data/tracks/elixir/exercises/pangram/pangram_test.exs +11 -11
  100. data/tracks/elixir/exercises/parallel-letter-frequency/parallel_letter_frequency_test.exs +10 -10
  101. data/tracks/elixir/exercises/pascals-triangle/pascals_triangle_test.exs +7 -7
  102. data/tracks/elixir/exercises/phone-number/phone_number_test.exs +10 -10
  103. data/tracks/elixir/exercises/prime-factors/prime_factors_test.exs +13 -13
  104. data/tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet_test.exs +8 -8
  105. data/tracks/elixir/exercises/queen-attack/queen_attack_test.exs +16 -16
  106. data/tracks/elixir/exercises/rail-fence-cipher/rail_fence_cipher_test.exs +13 -13
  107. data/tracks/elixir/exercises/raindrops/raindrops_test.exs +17 -17
  108. data/tracks/elixir/exercises/rna-transcription/rna_transcription_test.exs +6 -6
  109. data/tracks/elixir/exercises/robot-simulator/robot_simulator_test.exs +6 -6
  110. data/tracks/elixir/exercises/roman-numerals/roman_numerals_test.exs +19 -19
  111. data/tracks/elixir/exercises/run-length-encoding/rle_test.exs +6 -6
  112. data/tracks/elixir/exercises/saddle-points/saddle_points_test.exs +11 -11
  113. data/tracks/elixir/exercises/scrabble-score/scrabble_score_test.exs +9 -9
  114. data/tracks/elixir/exercises/sieve/sieve_test.exs +3 -3
  115. data/tracks/elixir/exercises/space-age/space_age_test.exs +9 -9
  116. data/tracks/elixir/exercises/sublist/sublist_test.exs +20 -20
  117. data/tracks/elixir/exercises/sum-of-multiples/sum_of_multiples_test.exs +11 -11
  118. data/tracks/elixir/exercises/test_helper.exs +1 -1
  119. data/tracks/elixir/exercises/triangle/triangle_test.exs +16 -16
  120. data/tracks/elixir/exercises/word-count/word_count_test.exs +9 -9
  121. data/tracks/elixir/exercises/wordy/wordy_test.exs +16 -16
  122. data/tracks/elixir/exercises/zipper/zipper_test.exs +13 -13
  123. data/tracks/fsharp/build.fsx +2 -7
  124. data/tracks/fsharp/config.json +0 -104
  125. data/tracks/fsharp/exercises/grep/GrepTest.fs +7 -1
  126. data/tracks/go/config.json +1 -0
  127. data/tracks/go/exercises/acronym/acronym_test.go +36 -0
  128. data/tracks/go/exercises/acronym/example.go +21 -0
  129. data/tracks/go/exercises/palindrome-products/example.go +2 -0
  130. data/tracks/go/exercises/palindrome-products/palindrome_products_test.go +10 -0
  131. data/tracks/go/exercises/phone-number/example.go +2 -0
  132. data/tracks/go/exercises/phone-number/phone_number_test.go +44 -27
  133. data/tracks/go/exercises/robot-simulator/defs.go +6 -6
  134. data/tracks/go/exercises/robot-simulator/example.go +22 -22
  135. data/tracks/go/exercises/robot-simulator/robot_simulator_step2_test.go +28 -28
  136. data/tracks/go/exercises/robot-simulator/robot_simulator_step3_test.go +75 -76
  137. data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +10 -4
  138. data/tracks/haskell/exercises/anagram/HINTS.md +22 -0
  139. data/tracks/haskell/exercises/anagram/package.yaml +3 -0
  140. data/tracks/haskell/exercises/anagram/src/Example.hs +10 -7
  141. data/tracks/haskell/exercises/anagram/test/Tests.hs +9 -3
  142. data/tracks/haskell/exercises/beer-song/HINTS.md +18 -0
  143. data/tracks/haskell/exercises/beer-song/src/Beer.hs +301 -3
  144. data/tracks/haskell/exercises/beer-song/src/Example.hs +5 -3
  145. data/tracks/haskell/exercises/beer-song/test/Tests.hs +332 -23
  146. data/tracks/haskell/exercises/crypto-square/src/CryptoSquare.hs +3 -17
  147. data/tracks/haskell/exercises/crypto-square/src/Example.hs +12 -20
  148. data/tracks/haskell/exercises/crypto-square/test/Tests.hs +46 -86
  149. data/tracks/haskell/exercises/leap/HINTS.md +11 -0
  150. data/tracks/haskell/exercises/leap/src/LeapYear.hs +1 -0
  151. data/tracks/java/exercises/pangram/src/test/java/PangramTest.java +34 -4
  152. data/tracks/lua/exercises/pov/pov_spec.lua +0 -13
  153. data/tracks/mips/docs/ABOUT.md +1 -1
  154. data/tracks/objective-c/config.json +225 -0
  155. data/tracks/objective-c/exercises/largest-series-product/LargestSeriesProductExample.h +8 -0
  156. data/tracks/objective-c/exercises/largest-series-product/LargestSeriesProductExample.m +63 -0
  157. data/tracks/objective-c/exercises/largest-series-product/LargestSeriesProductTest.m +84 -0
  158. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +18 -0
  159. data/tracks/ocaml/.travis-ci.sh +23 -0
  160. data/tracks/ocaml/.travis.yml +5 -1
  161. data/tracks/ocaml/Makefile +41 -0
  162. data/tracks/ocaml/config.json +18 -0
  163. data/tracks/ocaml/exercises/anagram/Makefile +1 -0
  164. data/tracks/ocaml/exercises/beer-song/Makefile +1 -0
  165. data/tracks/ocaml/exercises/beer-song/{beer.mli → beer_song.mli} +0 -0
  166. data/tracks/ocaml/exercises/beer-song/example.ml +1 -1
  167. data/tracks/ocaml/exercises/beer-song/test.ml +7 -6
  168. data/tracks/ocaml/exercises/bob/Makefile +1 -0
  169. data/tracks/ocaml/exercises/bowling/Makefile +1 -0
  170. data/tracks/ocaml/exercises/custom-set/Makefile +1 -0
  171. data/tracks/ocaml/exercises/difference-of-squares/.merlin +5 -0
  172. data/tracks/ocaml/exercises/difference-of-squares/Makefile +11 -0
  173. data/tracks/ocaml/exercises/difference-of-squares/difference_of_squares.mli +8 -0
  174. data/tracks/ocaml/exercises/difference-of-squares/example.ml +21 -0
  175. data/tracks/ocaml/exercises/difference-of-squares/test.ml +32 -0
  176. data/tracks/ocaml/exercises/grade-school/Makefile +1 -0
  177. data/tracks/ocaml/exercises/grade-school/{school.mli → grade_school.mli} +0 -0
  178. data/tracks/ocaml/exercises/grade-school/test.ml +27 -27
  179. data/tracks/ocaml/exercises/hamming/Makefile +1 -0
  180. data/tracks/ocaml/exercises/hangman/Makefile +1 -0
  181. data/tracks/ocaml/exercises/hello-world/Makefile +1 -1
  182. data/tracks/ocaml/exercises/hello-world/{hello.ml → hello_world.ml} +0 -0
  183. data/tracks/ocaml/exercises/hello-world/{hello.mli → hello_world.mli} +0 -0
  184. data/tracks/ocaml/exercises/hello-world/test.ml +1 -1
  185. data/tracks/ocaml/exercises/hexadecimal/Makefile +1 -0
  186. data/tracks/ocaml/exercises/leap/Makefile +1 -1
  187. data/tracks/ocaml/exercises/list-ops/Makefile +1 -0
  188. data/tracks/ocaml/exercises/luhn/Makefile +1 -0
  189. data/tracks/ocaml/exercises/minesweeper/Makefile +1 -0
  190. data/tracks/ocaml/exercises/nucleotide-count/Makefile +1 -0
  191. data/tracks/ocaml/exercises/nucleotide-count/{dna.mli → nucleotide_count.mli} +0 -0
  192. data/tracks/ocaml/exercises/nucleotide-count/test.ml +7 -7
  193. data/tracks/ocaml/exercises/phone-number/Makefile +1 -0
  194. data/tracks/ocaml/exercises/phone-number/{phone.mli → phone_number.mli} +0 -0
  195. data/tracks/ocaml/exercises/phone-number/test.ml +10 -10
  196. data/tracks/ocaml/exercises/point-mutations/Makefile +8 -0
  197. data/tracks/ocaml/exercises/point-mutations/example.ml +0 -0
  198. data/tracks/ocaml/exercises/prime-factors/Makefile +1 -0
  199. data/tracks/ocaml/exercises/raindrops/.merlin +5 -0
  200. data/tracks/ocaml/exercises/raindrops/Makefile +11 -0
  201. data/tracks/ocaml/exercises/raindrops/example.ml +11 -0
  202. data/tracks/ocaml/exercises/raindrops/raindrops.mli +7 -0
  203. data/tracks/ocaml/exercises/raindrops/test.ml +48 -0
  204. data/tracks/ocaml/exercises/rna-transcription/Makefile +1 -0
  205. data/tracks/ocaml/exercises/rna-transcription/{dna.mli → rna_transcription.mli} +0 -0
  206. data/tracks/ocaml/exercises/rna-transcription/test.ml +6 -6
  207. data/tracks/ocaml/exercises/roman-numerals/Makefile +1 -0
  208. data/tracks/ocaml/exercises/say/.gitignore +1 -0
  209. data/tracks/ocaml/exercises/say/.merlin +5 -0
  210. data/tracks/ocaml/exercises/say/Makefile +11 -0
  211. data/tracks/ocaml/exercises/say/example.ml +52 -0
  212. data/tracks/ocaml/exercises/say/say.mli +8 -0
  213. data/tracks/ocaml/exercises/say/test.ml +65 -0
  214. data/tracks/ocaml/exercises/space-age/Makefile +1 -0
  215. data/tracks/ocaml/exercises/word-count/Makefile +1 -0
  216. data/tracks/ocaml/exercises/word-count/example.ml +1 -1
  217. data/tracks/ocaml/exercises/zipper/HINT.md +5 -6
  218. data/tracks/ocaml/exercises/zipper/Makefile +1 -0
  219. data/tracks/ocaml/exercises/zipper/example.ml +2 -2
  220. data/tracks/ocaml/exercises/zipper/tree.ml +1 -1
  221. data/tracks/php/config.json +7 -1
  222. data/tracks/php/exercises/variable-length-quantity/example.php +56 -0
  223. data/tracks/php/exercises/variable-length-quantity/variable-length-quantity_test.php +149 -0
  224. data/tracks/python/config.json +1 -1
  225. data/tracks/ruby/.rubocop.yml +1915 -26
  226. data/tracks/ruby/bin/generate-acronym +7 -0
  227. data/tracks/ruby/bin/generate-nth-prime +7 -0
  228. data/tracks/ruby/config.json +482 -0
  229. data/tracks/ruby/exercises/acronym/.version +1 -0
  230. data/tracks/ruby/exercises/acronym/acronym_test.rb +45 -21
  231. data/tracks/ruby/exercises/acronym/example.rb +1 -1
  232. data/tracks/ruby/exercises/acronym/example.tt +19 -0
  233. data/tracks/ruby/exercises/anagram/anagram_test.rb +1 -1
  234. data/tracks/ruby/exercises/nth-prime/.version +1 -0
  235. data/tracks/ruby/exercises/nth-prime/example.rb +4 -0
  236. data/tracks/ruby/exercises/nth-prime/example.tt +23 -0
  237. data/tracks/ruby/exercises/nth-prime/nth_prime_test.rb +33 -10
  238. data/tracks/ruby/exercises/raindrops/.version +1 -1
  239. data/tracks/ruby/exercises/raindrops/example.rb +1 -1
  240. data/tracks/ruby/exercises/raindrops/raindrops_test.rb +20 -5
  241. data/tracks/ruby/lib/acronym_cases.rb +19 -0
  242. data/tracks/ruby/lib/generator.rb +3 -2
  243. data/tracks/ruby/lib/nth_prime_cases.rb +23 -0
  244. data/tracks/ruby/lib/raindrop_cases.rb +1 -1
  245. data/tracks/rust/README.md +1 -1
  246. data/tracks/scala/exercises/leap/src/test/scala/leap_test.scala +10 -0
  247. data/tracks/scala/exercises/prime-factors/example.scala +2 -5
  248. data/tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala +11 -13
  249. data/tracks/scheme/{anagram → exercises/anagram}/anagram-test.scm +0 -0
  250. data/tracks/scheme/{anagram → exercises/anagram}/anagram.scm +0 -0
  251. data/tracks/scheme/{anagram → exercises/anagram}/example.scm +0 -0
  252. data/tracks/scheme/{bob → exercises/bob}/bob-test.scm +0 -0
  253. data/tracks/scheme/{bob → exercises/bob}/bob.scm +0 -0
  254. data/tracks/scheme/{bob → exercises/bob}/example.scm +0 -0
  255. data/tracks/scheme/{difference-of-squares → exercises/difference-of-squares}/difference-of-squares-test.scm +0 -0
  256. data/tracks/scheme/{difference-of-squares → exercises/difference-of-squares}/example.scm +0 -0
  257. data/tracks/scheme/{difference-of-squares → exercises/difference-of-squares}/squares.scm +0 -0
  258. data/tracks/scheme/{grains → exercises/grains}/example.scm +0 -0
  259. data/tracks/scheme/{grains → exercises/grains}/grains-test.scm +0 -0
  260. data/tracks/scheme/{grains → exercises/grains}/grains.scm +0 -0
  261. data/tracks/scheme/{hamming → exercises/hamming}/example.scm +0 -0
  262. data/tracks/scheme/{hamming → exercises/hamming}/hamming-test.scm +0 -0
  263. data/tracks/scheme/{hamming → exercises/hamming}/hamming.scm +0 -0
  264. data/tracks/scheme/{hello-world → exercises/hello-world}/example.scm +0 -0
  265. data/tracks/scheme/{hello-world → exercises/hello-world}/hello-world-test.scm +0 -0
  266. data/tracks/scheme/{hello-world → exercises/hello-world}/hello-world.scm +0 -0
  267. data/tracks/scheme/{leap → exercises/leap}/example.scm +0 -0
  268. data/tracks/scheme/{leap → exercises/leap}/leap-test.scm +0 -0
  269. data/tracks/scheme/{leap → exercises/leap}/leap-year.scm +0 -0
  270. data/tracks/scheme/{list-ops → exercises/list-ops}/example.scm +0 -0
  271. data/tracks/scheme/{list-ops → exercises/list-ops}/list-ops-test.scm +0 -0
  272. data/tracks/scheme/{list-ops → exercises/list-ops}/list-ops.scm +0 -0
  273. data/tracks/scheme/{nucleotide-count → exercises/nucleotide-count}/example.scm +0 -0
  274. data/tracks/scheme/{nucleotide-count → exercises/nucleotide-count}/nucleotide-count-test.scm +0 -0
  275. data/tracks/scheme/{nucleotide-count → exercises/nucleotide-count}/nucleotide-count.scm +0 -0
  276. data/tracks/scheme/{phone-number → exercises/phone-number}/example.scm +0 -0
  277. data/tracks/scheme/{phone-number → exercises/phone-number}/phone-number-test.scm +0 -0
  278. data/tracks/scheme/{phone-number → exercises/phone-number}/phone-number.scm +0 -0
  279. data/tracks/scheme/{raindrops → exercises/raindrops}/example.scm +0 -0
  280. data/tracks/scheme/{raindrops → exercises/raindrops}/raindrops-test.scm +0 -0
  281. data/tracks/scheme/{raindrops → exercises/raindrops}/raindrops.scm +0 -0
  282. data/tracks/scheme/{rna-transcription → exercises/rna-transcription}/dna.scm +0 -0
  283. data/tracks/scheme/{rna-transcription → exercises/rna-transcription}/example.scm +0 -0
  284. data/tracks/scheme/{rna-transcription → exercises/rna-transcription}/rna-transcription-test.scm +0 -0
  285. data/tracks/scheme/{robot-name → exercises/robot-name}/example.scm +0 -0
  286. data/tracks/scheme/{robot-name → exercises/robot-name}/robot-name-test.scm +0 -0
  287. data/tracks/scheme/{robot-name → exercises/robot-name}/robot.scm +0 -0
  288. metadata +125 -64
@@ -6,5 +6,6 @@ test.native: *.ml *.mli
6
6
 
7
7
  clean:
8
8
  rm -rf _build
9
+ rm -f test.native
9
10
 
10
11
  .PHONY: clean
@@ -6,5 +6,6 @@ test.native: *.ml *.mli
6
6
 
7
7
  clean:
8
8
  rm -rf _build
9
+ rm -f test.native
9
10
 
10
11
  .PHONY: clean
@@ -7,7 +7,7 @@ open Core.Std
7
7
  * This uses manual string slicing to avoid depending on any regex package
8
8
  * and because regexes are best avoided for simple tasks.
9
9
  *)
10
- let (words : string -> string list) s =
10
+ let words (s: string): string list =
11
11
  let f i ((osi, l) as acc) c = match (osi, c) with
12
12
  | (None, c) when Char.is_alphanum c -> (Some i, l)
13
13
  | (Some si, c) when not (Char.is_alphanum c) -> (None, String.slice s si i :: l)
@@ -1,7 +1,6 @@
1
- ## with sexp
2
- The file `tree.ml` use the following expression: `with sexp`. Using this
3
- expression is [deprecated](https://github.com/janestreet/pa_sexp_conv). The
4
- alternative is using `[@@deriving sexp]`.
1
+ ## [@@deriving sexp]
2
+ The file `tree.ml` uses the following expression: `[@@deriving sexp]`. This
3
+ is described in (https://github.com/janestreet/pa_sexp_conv).
5
4
 
6
- Although at the moment `with sexp` can still be used, in could be removed in the
7
- future. So make sure to use the newer form in your own code.
5
+ If you have read the Real World OCaml book (http://realworldocaml.org), note
6
+ that the deriving attribute replaces the `with sexp` syntax described there.
@@ -6,5 +6,6 @@ test.native: *.ml *.mli
6
6
 
7
7
  clean:
8
8
  rm -rf _build
9
+ rm -f test.native
9
10
 
10
11
  .PHONY: clean
@@ -4,11 +4,11 @@ type 'a trail =
4
4
  | L of 'a * 'a Tree.t option * 'a trail (* Left path taken *)
5
5
  | R of 'a * 'a Tree.t option * 'a trail (* Right path taken *)
6
6
  | T (* Top level (root) *)
7
- with sexp
7
+ [@@deriving sexp]
8
8
 
9
9
  type 'a t = { value: 'a;
10
10
  left: 'a Tree.t option;
11
- right: 'a Tree.t option; trail: 'a trail } with sexp
11
+ right: 'a Tree.t option; trail: 'a trail } [@@deriving sexp]
12
12
 
13
13
  let rec equal veq a b =
14
14
  veq a.value b.value &&
@@ -1,7 +1,7 @@
1
1
  open Core.Std
2
2
 
3
3
  type 'a t = { value : 'a; left : 'a t option; right : 'a t option }
4
- with sexp
4
+ [@@deriving sexp]
5
5
 
6
6
  let rec equal veq a b =
7
7
  veq a.value b.value &&
@@ -32,7 +32,8 @@
32
32
  "atbash-cipher",
33
33
  "binary",
34
34
  "braket-push",
35
- "accumulate"
35
+ "accumulate",
36
+ "variable-length-quantity"
36
37
  ],
37
38
  "deprecated": [
38
39
 
@@ -189,6 +190,11 @@
189
190
  "slug": "accumulate",
190
191
  "difficulty": 1,
191
192
  "topics": []
193
+ },
194
+ {
195
+ "slug": "variable-length-quantity",
196
+ "difficulty": 1,
197
+ "topics": []
192
198
  }
193
199
  ]
194
200
  }
@@ -0,0 +1,56 @@
1
+ <?php
2
+
3
+ /**
4
+ * @param array $integers
5
+ * @return array
6
+ */
7
+ function vlq_encode(array $integers)
8
+ {
9
+ $result = [];
10
+
11
+ foreach ($integers as $integer) {
12
+ if ($integer > 0xfffffff) {
13
+ throw new InvalidArgumentException('The value is greater than the maximum allowed.');
14
+ }
15
+
16
+ $bytes = [];
17
+ do {
18
+ $byte = 0x7f & $integer;
19
+ array_unshift($bytes, empty($bytes) ? $byte : 0x80 | $byte);
20
+ $integer >>= 7;
21
+ } while ($integer > 0);
22
+ $result = array_merge($result, $bytes);
23
+ }
24
+
25
+ return $result;
26
+ }
27
+
28
+ /**
29
+ * @param array $bytes
30
+ * @return array
31
+ */
32
+ function vlq_decode(array $bytes)
33
+ {
34
+ $result = [];
35
+ $integer = 0;
36
+
37
+ foreach ($bytes as $byte) {
38
+ if ($integer > 0xfffffff - 0x7f) {
39
+ throw new OverflowException('The value exceeds the maximum allowed.');
40
+ }
41
+
42
+ $integer <<= 7;
43
+ $integer |= 0x7f & $byte;
44
+
45
+ if (($byte & 0x80) === 0) {
46
+ $result[] = $integer;
47
+ $integer = 0;
48
+ }
49
+ }
50
+
51
+ if (($byte & 0x80) !== 0) {
52
+ throw new InvalidArgumentException('Incomplete byte sequence.');
53
+ }
54
+
55
+ return $result;
56
+ }
@@ -0,0 +1,149 @@
1
+ <?php
2
+
3
+ require_once 'variable-length-quantity.php';
4
+
5
+ class VariableLengthQuantityTest extends PHPUnit_Framework_TestCase
6
+ {
7
+ public function testItEncodesSingleBytes()
8
+ {
9
+ $this->assertEquals([0x00], vlq_encode([0x00]));
10
+ $this->assertEquals([0x40], vlq_encode([0x40]));
11
+ $this->assertEquals([0x7f], vlq_encode([0x7f]));
12
+ }
13
+
14
+ public function testItEncodesDoubleBytes()
15
+ {
16
+ $this->markTestSkipped();
17
+
18
+ $this->assertEquals([0x81, 0x00], vlq_encode([0x80]));
19
+ $this->assertEquals([0xc0, 0x00], vlq_encode([0x2000]));
20
+ $this->assertEquals([0xff, 0x7f], vlq_encode([0x3fff]));
21
+ }
22
+
23
+ public function testItEncodesTripleBytes()
24
+ {
25
+ $this->markTestSkipped();
26
+
27
+ $this->assertEquals([0x81, 0x80, 0x00], vlq_encode([0x4000]));
28
+ $this->assertEquals([0xc0, 0x80, 0x00], vlq_encode([0x100000]));
29
+ $this->assertEquals([0xff, 0xff, 0x7f], vlq_encode([0x1fffff]));
30
+ }
31
+
32
+ public function testItEncodesQuadrupleBytes()
33
+ {
34
+ $this->markTestSkipped();
35
+
36
+ $this->assertEquals([0x81, 0x80, 0x80, 0x00], vlq_encode([0x200000]));
37
+ $this->assertEquals([0xc0, 0x80, 0x80, 0x00], vlq_encode([0x8000000]));
38
+ $this->assertEquals([0xff, 0xff, 0xff, 0x7f], vlq_encode([0xfffffff]));
39
+ }
40
+
41
+ public function testItEncodesMultipleValues()
42
+ {
43
+ $this->markTestSkipped();
44
+
45
+ $this->assertEquals([0x00, 0x00], vlq_encode([0x00, 0x00]));
46
+ $this->assertEquals([0x40, 0x7f], vlq_encode([0x40, 0x7f]));
47
+ $this->assertEquals([0x81, 0x80, 0x00, 0xc8, 0xe8, 0x56], vlq_encode([0x4000, 0x123456]));
48
+ $this->assertEquals([
49
+ 0xc0, 0x00, 0xc8, 0xe8, 0x56,
50
+ 0xff, 0xff, 0xff, 0x7f, 0x00,
51
+ 0xff, 0x7f, 0x81, 0x80, 0x00,
52
+ ], vlq_encode(
53
+ [0x2000, 0x123456, 0x0fffffff, 0x00, 0x3fff, 0x4000]
54
+ ));
55
+ }
56
+
57
+ public function testItDecodesFromSyngleBytes()
58
+ {
59
+ $this->markTestSkipped();
60
+
61
+ $this->assertEquals([0x00], vlq_decode([0x00]));
62
+ $this->assertEquals([0x40], vlq_decode([0x40]));
63
+ $this->assertEquals([0x7f], vlq_decode([0x7f]));
64
+ }
65
+
66
+ public function testItDecodesDoubleBytes()
67
+ {
68
+ $this->markTestSkipped();
69
+
70
+ $this->assertEquals([0x80], vlq_decode([0x81, 0x00]));
71
+ $this->assertEquals([0x2000], vlq_decode([0xc0, 0x00]));
72
+ $this->assertEquals([0x3fff], vlq_decode([0xff, 0x7f]));
73
+ }
74
+
75
+ public function testItDecodesTripleBytes()
76
+ {
77
+ $this->markTestSkipped();
78
+
79
+ $this->assertEquals([0x4000], vlq_decode([0x81, 0x80, 0x00]));
80
+ $this->assertEquals([0x100000], vlq_decode([0xc0, 0x80, 0x00]));
81
+ $this->assertEquals([0x1FFFFF], vlq_decode([0xff, 0xff, 0x7f]));
82
+ }
83
+
84
+ public function testItDecodesQuadrupleBytes()
85
+ {
86
+ $this->markTestSkipped();
87
+
88
+ $this->assertEquals([0x200000], vlq_decode([0x81, 0x80, 0x80, 0x00]));
89
+ $this->assertEquals([0x8000000], vlq_decode([0xc0, 0x80, 0x80, 0x00]));
90
+ $this->assertEquals([0xFFFFFFF], vlq_decode([0xff, 0xff, 0xff, 0x7f]));
91
+ }
92
+
93
+ public function testItDecodesMultipleValues()
94
+ {
95
+ $this->markTestSkipped();
96
+
97
+ $this->assertEquals([0x00, 0x00], vlq_decode([0x00, 0x00]));
98
+ $this->assertEquals([0x40, 0x7f], vlq_decode([0x40, 0x7f]));
99
+ $this->assertEquals([0x4000, 0x123456], vlq_decode([0x81, 0x80, 0x00, 0xc8, 0xe8, 0x56]));
100
+ $this->assertEquals(
101
+ [0x2000, 0x123456, 0x0fffffff, 0x00, 0x3fff, 0x4000],
102
+ vlq_decode([
103
+ 0xc0, 0x00, 0xc8, 0xe8, 0x56,
104
+ 0xff, 0xff, 0xff, 0x7f, 0x00,
105
+ 0xff, 0x7f, 0x81, 0x80, 0x00,
106
+ ])
107
+ );
108
+ }
109
+
110
+ public function testIncompleteByteSequence()
111
+ {
112
+ $this->markTestSkipped();
113
+
114
+ $this->setExpectedException(InvalidArgumentException::class);
115
+
116
+ vlq_decode([0xff]);
117
+ }
118
+
119
+ public function testOverflow()
120
+ {
121
+ $this->markTestSkipped();
122
+
123
+ $this->setExpectedException(OverflowException::class);
124
+
125
+ vlq_decode([0xff, 0xff, 0xff, 0xff, 0xff]);
126
+ }
127
+
128
+ public function testChainedDecodeEncodeGivesOriginalBytes()
129
+ {
130
+ $this->markTestSkipped();
131
+
132
+ $bytes = [
133
+ 0xc0, 0x00, 0xc8, 0xe8, 0x56,
134
+ 0xff, 0xff, 0xff, 0x7f, 0x00,
135
+ 0xff, 0x7f, 0x81, 0x80, 0x00,
136
+ ];
137
+
138
+ $this->assertTrue($bytes === vlq_encode(vlq_decode($bytes)));
139
+ }
140
+
141
+ public function testChainedEncodeDecodeGivesOriginalIntegers()
142
+ {
143
+ $this->markTestSkipped();
144
+
145
+ $integers = [0x2000, 0x123456, 0x0fffffff, 0x00, 0x3fff, 0x4000];
146
+
147
+ $this->assertEquals($integers, vlq_decode(vlq_encode($integers)));
148
+ }
149
+ }
@@ -71,7 +71,7 @@
71
71
  "slug": "hello-world",
72
72
  "difficulty": 1,
73
73
  "topics": [
74
- "control-flow (if-statements)",
74
+ "control-flow (if-else statements)",
75
75
  "optional values",
76
76
  "text formatting"
77
77
  ]
@@ -1,30 +1,1919 @@
1
- AllCops:
2
- Exclude:
3
- - 'exercises/**/example.rb'
4
- - 'bin/*'
5
- Documentation:
6
- Enabled: false
7
- StringLiterals:
8
- Enabled: true
1
+ # Type 'Lint' (48):
2
+ Lint/AmbiguousOperator:
3
+ Description: Checks for ambiguous operators in the first argument of a method invocation
4
+ without parentheses.
5
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
6
+ Enabled: false
7
+
8
+ Lint/AmbiguousRegexpLiteral:
9
+ Description: Checks for ambiguous regexp literals in the first argument of a method
10
+ invocation without parentheses.
11
+ Enabled: false
12
+
13
+ Lint/AssignmentInCondition:
14
+ Description: Don't use assignment in conditions.
15
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
16
+ Enabled: false
17
+ AllowSafeAssignment: true
18
+
19
+ # Supports --auto-correct
20
+ Lint/BlockAlignment:
21
+ Description: Align block ends correctly.
22
+ Enabled: false
23
+
24
+ Lint/CircularArgumentReference:
25
+ Description: Default values in optional keyword arguments and optional ordinal arguments
26
+ should not refer back to the name of the argument.
27
+ Enabled: false
28
+
29
+ Lint/ConditionPosition:
30
+ Description: Checks for condition placed in a confusing position relative to the keyword.
31
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
32
+ Enabled: false
33
+
34
+ # Supports --auto-correct
35
+ Lint/Debugger:
36
+ Description: Check for debugger calls.
37
+ Enabled: false
38
+
39
+ # Supports --auto-correct
40
+ Lint/DefEndAlignment:
41
+ Description: Align ends corresponding to defs correctly.
42
+ Enabled: false
43
+ AlignWith: start_of_line
44
+ SupportedStyles:
45
+ - start_of_line
46
+ - def
47
+ AutoCorrect: false
48
+
49
+ # Supports --auto-correct
50
+ Lint/DeprecatedClassMethods:
51
+ Description: Check for deprecated class method calls.
52
+ Enabled: false
53
+
54
+ Lint/DuplicateMethods:
55
+ Description: Check for duplicate method definitions.
56
+ Enabled: false
57
+
58
+ Lint/DuplicatedKey:
59
+ Description: Check for duplicate keys in hash literals.
60
+ Enabled: false
61
+
62
+ Lint/EachWithObjectArgument:
63
+ Description: Check for immutable argument given to each_with_object.
64
+ Enabled: false
65
+
66
+ Lint/ElseLayout:
67
+ Description: Check for odd code arrangement in an else block.
68
+ Enabled: false
69
+
70
+ Lint/EmptyEnsure:
71
+ Description: Checks for empty ensure block.
72
+ Enabled: false
73
+
74
+ Lint/EmptyInterpolation:
75
+ Description: Checks for empty string interpolation.
76
+ Enabled: false
77
+
78
+ # Supports --auto-correct
79
+ Lint/EndAlignment:
80
+ Description: Align ends correctly.
81
+ Enabled: false
82
+ AlignWith: keyword
83
+ SupportedStyles:
84
+ - keyword
85
+ - variable
86
+ - start_of_line
87
+ AutoCorrect: false
88
+
89
+ Lint/EndInMethod:
90
+ Description: END blocks should not be placed inside method definitions.
91
+ Enabled: false
92
+
93
+ Lint/EnsureReturn:
94
+ Description: Do not use return in an ensure block.
95
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
96
+ Enabled: false
97
+
98
+ Lint/Eval:
99
+ Description: The use of eval represents a serious security risk.
100
+ Enabled: false
101
+
102
+ Lint/FloatOutOfRange:
103
+ Description: Catches floating-point literals too large or small for Ruby to represent.
104
+ Enabled: false
105
+
106
+ Lint/FormatParameterMismatch:
107
+ Description: The number of parameters to format/sprint must match the fields.
108
+ Enabled: false
109
+
110
+ Lint/HandleExceptions:
111
+ Description: Don't suppress exception.
112
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
113
+ Enabled: false
114
+
115
+ Lint/ImplicitStringConcatenation:
116
+ Description: Checks for adjacent string literals on the same line, which could better
117
+ be represented as a single string literal.
118
+ Enabled: false
119
+
120
+ Lint/IneffectiveAccessModifier:
121
+ Description: Checks for attempts to use `private` or `protected` to set the visibility
122
+ of a class method, which does not work.
123
+ Enabled: false
124
+
125
+ Lint/InvalidCharacterLiteral:
126
+ Description: Checks for invalid character literals with a non-escaped whitespace character.
127
+ Enabled: false
128
+
129
+ Lint/LiteralInCondition:
130
+ Description: Checks of literals used in conditions.
131
+ Enabled: false
132
+
133
+ # Supports --auto-correct
134
+ Lint/LiteralInInterpolation:
135
+ Description: Avoid interpolating literals in strings
136
+ Enabled: false
137
+ AutoCorrect: false
138
+
139
+ Lint/Loop:
140
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
141
+ for post-loop tests.
142
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
143
+ Enabled: false
144
+
145
+ Lint/NestedMethodDefinition:
146
+ Description: Do not use nested method definitions.
147
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods
148
+ Enabled: false
149
+
150
+ Lint/NextWithoutAccumulator:
151
+ Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject`
152
+ block.
153
+ Enabled: false
154
+
155
+ Lint/NonLocalExitFromIterator:
156
+ Description: Do not use return in iterator to cause non-local exit.
157
+ Enabled: false
158
+
159
+ Lint/ParenthesesAsGroupedExpression:
160
+ Description: Checks for method calls with a space before the opening parenthesis.
161
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
162
+ Enabled: false
163
+
164
+ Lint/RandOne:
165
+ Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely
166
+ a mistake.
167
+ Enabled: false
168
+
169
+ Lint/RequireParentheses:
170
+ Description: Use parentheses in the method call to avoid confusion about precedence.
171
+ Enabled: false
172
+
173
+ Lint/RescueException:
174
+ Description: Avoid rescuing the Exception class.
175
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
176
+ Enabled: false
177
+
178
+ Lint/ShadowingOuterLocalVariable:
179
+ Description: Do not use the same name as outer local variable for block arguments
180
+ or block local variables.
181
+ Enabled: false
182
+
183
+ # Supports --auto-correct
184
+ Lint/StringConversionInInterpolation:
185
+ Description: Checks for Object#to_s usage in string interpolation.
186
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
187
+ Enabled: false
188
+
189
+ Lint/UnderscorePrefixedVariableName:
190
+ Description: Do not use prefix `_` for a variable that is used.
191
+ Enabled: false
192
+
193
+ # Supports --auto-correct
194
+ Lint/UnneededDisable:
195
+ Description: 'Checks for rubocop:disable comments that can be removed. Note: this
196
+ cop is not disabled when disabling all cops. It must be explicitly disabled.'
197
+ Enabled: false
198
+
199
+ Lint/UnreachableCode:
200
+ Description: Unreachable code.
201
+ Enabled: false
202
+
203
+ # Supports --auto-correct
204
+ Lint/UnusedBlockArgument:
205
+ Description: Checks for unused block arguments.
206
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
207
+ Enabled: false
208
+ IgnoreEmptyBlocks: true
209
+
210
+ # Supports --auto-correct
211
+ Lint/UnusedMethodArgument:
212
+ Description: Checks for unused method arguments.
213
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
214
+ Enabled: false
215
+ AllowUnusedKeywordArguments: false
216
+ IgnoreEmptyMethods: true
217
+
218
+ Lint/UselessAccessModifier:
219
+ Description: Checks for useless access modifiers.
220
+ Enabled: false
221
+
222
+ Lint/UselessAssignment:
223
+ Description: Checks for useless assignment to a local variable.
224
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
225
+ Enabled: false
226
+
227
+ Lint/UselessComparison:
228
+ Description: Checks for comparison of something with itself.
229
+ Enabled: false
230
+
231
+ Lint/UselessElseWithoutRescue:
232
+ Description: Checks for useless `else` in `begin..end` without `rescue`.
233
+ Enabled: false
234
+
235
+ Lint/UselessSetterCall:
236
+ Description: Checks for useless setter call to a local variable.
237
+ Enabled: false
238
+
239
+ Lint/Void:
240
+ Description: Possible use of operator/literal/variable in void context.
241
+ Enabled: false
242
+
243
+ # Type 'Metrics' (9):
9
244
  Metrics/AbcSize:
245
+ Description: A calculated magnitude based on number of assignments, branches, and
246
+ conditions.
247
+ Reference: http://c2.com/cgi/wiki?AbcMetric
10
248
  Enabled: false
11
- SpaceAroundEqualsInParameterDefault:
12
- EnforcedStyle: no_space
13
- TrailingCommaInArguments:
14
- EnforcedStyleForMultiline: comma
15
- BlockDelimiters:
16
- Enabled: true
17
- RaiseArgs:
18
- Enabled: true
19
- EnforcedStyle: compact
249
+ Max: 15
250
+
251
+ Metrics/BlockNesting:
252
+ Description: Avoid excessive block nesting
253
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
254
+ Enabled: false
255
+ Max: 3
256
+
20
257
  Metrics/ClassLength:
21
- Max: 454
22
- AndOr:
23
- Enabled: true
24
- EnforcedStyle: conditionals
25
- FormatString:
26
- Enabled: true
258
+ Description: Avoid classes longer than 100 lines of code.
259
+ Enabled: false
260
+ CountComments: false
261
+ Max: 100
262
+
263
+ Metrics/CyclomaticComplexity:
264
+ Description: A complexity metric that is strongly correlated to the number of test
265
+ cases needed to validate a method.
266
+ Enabled: false
267
+ Max: 6
268
+
269
+ Metrics/LineLength:
270
+ Description: Limit lines to 80 characters.
271
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
272
+ Enabled: false
273
+ Max: 80
274
+ AllowHeredoc: true
275
+ AllowURI: true
276
+ URISchemes:
277
+ - http
278
+ - https
279
+
280
+ Metrics/MethodLength:
281
+ Description: Avoid methods longer than 10 lines of code.
282
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
283
+ Enabled: false
284
+ CountComments: false
285
+ Max: 10
286
+
287
+ Metrics/ModuleLength:
288
+ Description: Avoid modules longer than 100 lines of code.
289
+ Enabled: false
290
+ CountComments: false
291
+ Max: 100
292
+
293
+ Metrics/ParameterLists:
294
+ Description: Avoid parameter lists longer than three or four parameters.
295
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
296
+ Enabled: false
297
+ Max: 5
298
+ CountKeywordArgs: true
299
+
300
+ Metrics/PerceivedComplexity:
301
+ Description: A complexity metric geared towards measuring complexity for a human reader.
302
+ Enabled: false
303
+ Max: 7
304
+
305
+ # Type 'Performance' (21):
306
+ # Supports --auto-correct
307
+ Performance/CaseWhenSplat:
308
+ Description: Place `when` conditions that use splat at the end of the list of `when`
309
+ branches.
310
+ Enabled: false
311
+
312
+ # Supports --auto-correct
313
+ Performance/Casecmp:
314
+ Description: Use `casecmp` rather than `downcase ==`.
315
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
316
+ Enabled: false
317
+
318
+ # Supports --auto-correct
319
+ Performance/Count:
320
+ Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
321
+ `reject...count`, `select...length`, and `reject...length`.
322
+ Enabled: false
323
+
324
+ # Supports --auto-correct
325
+ Performance/Detect:
326
+ Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
327
+ and `find_all.last`.
328
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
329
+ Enabled: false
330
+
331
+ Performance/DoubleStartEndWith:
332
+ Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
333
+ ...) || str.{start,end}_with?(y, ...)`.
334
+ Enabled: false
335
+
336
+ # Supports --auto-correct
337
+ Performance/EndWith:
338
+ Description: Use `end_with?` instead of a regex match anchored to the end of a string.
339
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
340
+ Enabled: false
341
+
342
+ Performance/FixedSize:
343
+ Description: Do not compute the size of statically sized objects except in constants
344
+ Enabled: false
345
+
346
+ # Supports --auto-correct
347
+ Performance/FlatMap:
348
+ Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
349
+ or `Enumberable#collect..Array#flatten(1)`
350
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
351
+ Enabled: false
352
+ EnabledForFlattenWithoutParams: false
353
+
354
+ # Supports --auto-correct
355
+ Performance/HashEachMethods:
356
+ Description: Use `Hash#each_key` and `Hash#each_value` instead of `Hash#keys.each`
357
+ and `Hash#values.each`.
358
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-each
359
+ Enabled: false
360
+ AutoCorrect: false
361
+
362
+ # Supports --auto-correct
363
+ Performance/LstripRstrip:
364
+ Description: Use `strip` instead of `lstrip.rstrip`.
365
+ Enabled: false
366
+
367
+ # Supports --auto-correct
368
+ Performance/RangeInclude:
369
+ Description: Use `Range#cover?` instead of `Range#include?`.
370
+ Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
371
+ Enabled: false
372
+
373
+ # Supports --auto-correct
374
+ Performance/RedundantBlockCall:
375
+ Description: Use `yield` instead of `block.call`.
376
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
377
+ Enabled: false
378
+
379
+ # Supports --auto-correct
380
+ Performance/RedundantMatch:
381
+ Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
382
+ the returned `MatchData` is not needed.
383
+ Enabled: false
384
+
385
+ # Supports --auto-correct
386
+ Performance/RedundantMerge:
387
+ Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
388
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
389
+ Enabled: false
390
+
391
+ # Supports --auto-correct
392
+ Performance/RedundantSortBy:
393
+ Description: Use `sort` instead of `sort_by { |x| x }`.
394
+ Enabled: false
395
+
396
+ # Supports --auto-correct
397
+ Performance/ReverseEach:
398
+ Description: Use `reverse_each` instead of `reverse.each`.
399
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
400
+ Enabled: false
401
+
402
+ # Supports --auto-correct
403
+ Performance/Sample:
404
+ Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`.
405
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
406
+ Enabled: false
407
+
408
+ # Supports --auto-correct
409
+ Performance/Size:
410
+ Description: Use `size` instead of `count` for counting the number of elements in
411
+ `Array` and `Hash`.
412
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
413
+ Enabled: false
414
+
415
+ # Supports --auto-correct
416
+ Performance/StartWith:
417
+ Description: Use `start_with?` instead of a regex match anchored to the beginning
418
+ of a string.
419
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
420
+ Enabled: false
421
+
422
+ # Supports --auto-correct
423
+ Performance/StringReplacement:
424
+ Description: Use `tr` instead of `gsub` when you are replacing the same number of
425
+ characters. Use `delete` instead of `gsub` when you are deleting characters.
426
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
427
+ Enabled: false
428
+
429
+ Performance/TimesMap:
430
+ Description: Checks for .times.map calls.
431
+ Enabled: false
432
+
433
+ # Type 'Rails' (12):
434
+ # Supports --auto-correct
435
+ Rails/ActionFilter:
436
+ Description: Enforces consistent use of action filter methods.
437
+ Enabled: false
438
+ EnforcedStyle: action
439
+ SupportedStyles:
440
+ - action
441
+ - filter
442
+ Include:
443
+ - app/controllers/**/*.rb
444
+
445
+ Rails/Date:
446
+ Description: Checks the correct usage of date aware methods, such as Date.today, Date.current
447
+ etc.
448
+ Enabled: false
449
+ EnforcedStyle: flexible
450
+ SupportedStyles:
451
+ - strict
452
+ - flexible
453
+
454
+ # Supports --auto-correct
455
+ Rails/Delegate:
456
+ Description: Prefer delegate method for delegations.
457
+ Enabled: false
458
+
459
+ # Supports --auto-correct
460
+ Rails/FindBy:
461
+ Description: Prefer find_by over where.first.
462
+ Enabled: false
463
+ Include:
464
+ - app/models/**/*.rb
465
+
466
+ # Supports --auto-correct
467
+ Rails/FindEach:
468
+ Description: Prefer all.find_each over all.find.
469
+ Enabled: false
470
+ Include:
471
+ - app/models/**/*.rb
472
+
473
+ Rails/HasAndBelongsToMany:
474
+ Description: Prefer has_many :through to has_and_belongs_to_many.
475
+ Enabled: false
476
+ Include:
477
+ - app/models/**/*.rb
478
+
479
+ Rails/Output:
480
+ Description: Checks for calls to puts, print, etc.
481
+ Enabled: false
482
+ Include:
483
+ - app/**/*.rb
484
+ - config/**/*.rb
485
+ - db/**/*.rb
486
+ - lib/**/*.rb
487
+
488
+ # Supports --auto-correct
489
+ Rails/PluralizationGrammar:
490
+ Description: Checks for incorrect grammar when using methods like `3.day.ago`.
491
+ Enabled: false
492
+
493
+ # Supports --auto-correct
494
+ Rails/ReadWriteAttribute:
495
+ Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
496
+ Enabled: false
497
+ Include:
498
+ - app/models/**/*.rb
499
+
500
+ Rails/ScopeArgs:
501
+ Description: Checks the arguments of ActiveRecord scopes.
502
+ Enabled: false
503
+ Include:
504
+ - app/models/**/*.rb
505
+
506
+ Rails/TimeZone:
507
+ Description: Checks the correct usage of time zone aware methods.
508
+ StyleGuide: https://github.com/bbatsov/rails-style-guide#time
509
+ Reference: http://danilenko.org/2012/7/6/rails_timezones
510
+ Enabled: false
511
+ EnforcedStyle: flexible
512
+ SupportedStyles:
513
+ - strict
514
+ - flexible
515
+
516
+ Rails/Validation:
517
+ Description: Use validates :attribute, hash of validations.
518
+ Enabled: false
519
+ Include:
520
+ - app/models/**/*.rb
521
+
522
+ # Type 'Style' (184):
523
+ # Supports --auto-correct
524
+ Style/AccessModifierIndentation:
525
+ Description: Check indentation of private/protected visibility modifiers.
526
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
527
+ Enabled: false
528
+ EnforcedStyle: indent
529
+ SupportedStyles:
530
+ - outdent
531
+ - indent
532
+ IndentationWidth:
533
+
534
+ Style/AccessorMethodName:
535
+ Description: Check the naming of accessor methods for get_/set_.
536
+ Enabled: false
537
+
538
+ # Supports --auto-correct
539
+ Style/Alias:
540
+ Description: Use alias_method instead of alias.
541
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
542
+ Enabled: false
543
+ EnforcedStyle: prefer_alias
544
+ SupportedStyles:
545
+ - prefer_alias
546
+ - prefer_alias_method
547
+
548
+ # Supports --auto-correct
549
+ Style/AlignArray:
550
+ Description: Align the elements of an array literal if they span more than one line.
551
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
552
+ Enabled: false
553
+
554
+ # Supports --auto-correct
555
+ Style/AlignHash:
556
+ Description: Align the elements of a hash literal if they span more than one line.
557
+ Enabled: false
558
+ EnforcedHashRocketStyle: key
559
+ EnforcedColonStyle: key
560
+ EnforcedLastArgumentHashStyle: always_inspect
561
+ SupportedLastArgumentHashStyles:
562
+ - always_inspect
563
+ - always_ignore
564
+ - ignore_implicit
565
+ - ignore_explicit
566
+
567
+ # Supports --auto-correct
568
+ Style/AlignParameters:
569
+ Description: Align the parameters of a method call if they span more than one line.
570
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
571
+ Enabled: false
572
+ EnforcedStyle: with_first_parameter
573
+ SupportedStyles:
574
+ - with_first_parameter
575
+ - with_fixed_indentation
576
+
577
+ # Supports --auto-correct
578
+ Style/AndOr:
579
+ Description: Use &&/|| instead of and/or.
580
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
581
+ Enabled: false
582
+ EnforcedStyle: always
583
+ SupportedStyles:
584
+ - always
585
+ - conditionals
586
+
587
+ # Supports --auto-correct
588
+ Style/ArrayJoin:
589
+ Description: Use Array#join instead of Array#*.
590
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
591
+ Enabled: false
592
+
593
+ Style/AsciiComments:
594
+ Description: Use only ascii symbols in comments.
595
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
596
+ Enabled: false
597
+
598
+ Style/AsciiIdentifiers:
599
+ Description: Use only ascii symbols in identifiers.
600
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
601
+ Enabled: false
602
+
603
+ # Supports --auto-correct
604
+ Style/Attr:
605
+ Description: Checks for uses of Module#attr.
606
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
607
+ Enabled: false
608
+
609
+ Style/AutoResourceCleanup:
610
+ Description: Suggests the usage of an auto resource cleanup version of a method (if
611
+ available).
612
+ Enabled: false
613
+
614
+ # Supports --auto-correct
615
+ Style/BarePercentLiterals:
616
+ Description: Checks if usage of %() or %Q() matches configuration.
617
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
618
+ Enabled: false
619
+ EnforcedStyle: bare_percent
620
+ SupportedStyles:
621
+ - percent_q
622
+ - bare_percent
623
+
624
+ Style/BeginBlock:
625
+ Description: Avoid the use of BEGIN blocks.
626
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
627
+ Enabled: false
628
+
629
+ # Supports --auto-correct
630
+ Style/BlockComments:
631
+ Description: Do not use block comments.
632
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
633
+ Enabled: false
634
+
635
+ # Supports --auto-correct
636
+ Style/BlockDelimiters:
637
+ Description: Avoid using {...} for multi-line blocks (multiline chaining is always
638
+ ugly). Prefer {...} over do...end for single-line blocks.
639
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
640
+ Enabled: false
641
+ EnforcedStyle: line_count_based
642
+ SupportedStyles:
643
+ - line_count_based
644
+ - semantic
645
+ - braces_for_chaining
646
+ ProceduralMethods:
647
+ - benchmark
648
+ - bm
649
+ - bmbm
650
+ - create
651
+ - each_with_object
652
+ - measure
653
+ - new
654
+ - realtime
655
+ - tap
656
+ - with_object
657
+ FunctionalMethods:
658
+ - let
659
+ - let!
660
+ - subject
661
+ - watch
662
+ IgnoredMethods:
663
+ - lambda
664
+ - proc
665
+ - it
666
+
667
+ # Supports --auto-correct
668
+ Style/BlockEndNewline:
669
+ Description: Put end statement of multiline block on its own line.
670
+ Enabled: false
671
+
672
+ # Supports --auto-correct
673
+ Style/BracesAroundHashParameters:
674
+ Description: Enforce braces style around hash parameters.
675
+ Enabled: false
676
+ EnforcedStyle: no_braces
677
+ SupportedStyles:
678
+ - braces
679
+ - no_braces
680
+ - context_dependent
681
+
682
+ Style/CaseEquality:
683
+ Description: Avoid explicit use of the case equality operator(===).
684
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
685
+ Enabled: false
686
+
687
+ # Supports --auto-correct
688
+ Style/CaseIndentation:
689
+ Description: Indentation of when in a case/when/[else/]end.
690
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
691
+ Enabled: false
692
+ IndentWhenRelativeTo: case
693
+ SupportedStyles:
694
+ - case
695
+ - end
696
+ IndentOneStep: false
697
+ IndentationWidth:
698
+
699
+ # Supports --auto-correct
700
+ Style/CharacterLiteral:
701
+ Description: Checks for uses of character literals.
702
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
703
+ Enabled: false
704
+
705
+ Style/ClassAndModuleCamelCase:
706
+ Description: Use CamelCase for classes and modules.
707
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
708
+ Enabled: false
709
+
710
+ Style/ClassAndModuleChildren:
711
+ Description: Checks style of children classes and modules.
712
+ Enabled: false
713
+ EnforcedStyle: nested
714
+ SupportedStyles:
715
+ - nested
716
+ - compact
717
+
718
+ # Supports --auto-correct
719
+ Style/ClassCheck:
720
+ Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
721
+ Enabled: false
722
+ EnforcedStyle: is_a?
723
+ SupportedStyles:
724
+ - is_a?
725
+ - kind_of?
726
+
727
+ # Supports --auto-correct
728
+ Style/ClassMethods:
729
+ Description: Use self when defining module/class methods.
730
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-class-methods
731
+ Enabled: false
732
+
733
+ Style/ClassVars:
734
+ Description: Avoid the use of class variables.
735
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
736
+ Enabled: false
737
+
738
+ # Supports --auto-correct
739
+ Style/ClosingParenthesisIndentation:
740
+ Description: Checks the indentation of hanging closing parentheses.
741
+ Enabled: false
742
+
743
+ # Supports --auto-correct
744
+ Style/CollectionMethods:
745
+ Description: Preferred collection methods.
746
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
747
+ Enabled: false
748
+ PreferredMethods:
749
+ collect: map
750
+ collect!: map!
751
+ inject: reduce
752
+ detect: find
753
+ find_all: select
754
+
755
+ # Supports --auto-correct
756
+ Style/ColonMethodCall:
757
+ Description: 'Do not use :: for method call.'
758
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
759
+ Enabled: false
760
+
761
+ # Supports --auto-correct
762
+ Style/CommandLiteral:
763
+ Description: Use `` or %x around command literals.
764
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
765
+ Enabled: false
766
+ EnforcedStyle: backticks
767
+ SupportedStyles:
768
+ - backticks
769
+ - percent_x
770
+ - mixed
771
+ AllowInnerBackticks: false
772
+
773
+ # Supports --auto-correct
774
+ Style/CommentAnnotation:
775
+ Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
776
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
777
+ Enabled: false
778
+ Keywords:
779
+ - TODO
780
+ - FIXME
781
+ - OPTIMIZE
782
+ - HACK
783
+ - REVIEW
784
+
785
+ # Supports --auto-correct
786
+ Style/CommentIndentation:
787
+ Description: Indentation of comments.
788
+ Enabled: false
789
+
790
+ # Supports --auto-correct
791
+ Style/ConditionalAssignment:
792
+ Description: Use the return value of `if` and `case` statements for assignment to
793
+ a variable and variable comparison instead of assigning that variable inside of
794
+ each branch.
795
+ Enabled: false
796
+ SingleLineConditionsOnly: true
797
+
798
+ Style/ConstantName:
799
+ Description: Constants should use SCREAMING_SNAKE_CASE.
800
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
801
+ Enabled: false
802
+
803
+ # Supports --auto-correct
804
+ Style/Copyright:
805
+ Description: Include a copyright notice in each file before any code.
806
+ Enabled: false
807
+ Notice: "^Copyright (\\(c\\) )?2[0-9]{3} .+"
808
+ AutocorrectNotice: ''
809
+
810
+ # Supports --auto-correct
811
+ Style/DefWithParentheses:
812
+ Description: Use def with parentheses when there are arguments.
813
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
814
+ Enabled: false
815
+
816
+ # Supports --auto-correct
817
+ Style/DeprecatedHashMethods:
818
+ Description: Checks for use of deprecated Hash methods.
819
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
820
+ Enabled: false
821
+
822
+ Style/Documentation:
823
+ Description: Document classes and non-namespace modules.
824
+ Enabled: false
825
+
826
+ # Supports --auto-correct
827
+ Style/DotPosition:
828
+ Description: Checks the position of the dot in multi-line method calls.
829
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
830
+ Enabled: false
831
+ EnforcedStyle: leading
832
+ SupportedStyles:
833
+ - leading
834
+ - trailing
835
+
836
+ Style/DoubleNegation:
837
+ Description: Checks for uses of double negation (!!).
838
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
839
+ Enabled: false
840
+
841
+ Style/EachWithObject:
842
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
843
+ Enabled: false
844
+
845
+ # Supports --auto-correct
846
+ Style/ElseAlignment:
847
+ Description: Align elses and elsifs correctly.
848
+ Enabled: false
849
+
850
+ # Supports --auto-correct
851
+ Style/EmptyElse:
852
+ Description: Avoid empty else-clauses.
853
+ Enabled: false
854
+ EnforcedStyle: both
855
+ SupportedStyles:
856
+ - empty
857
+ - nil
858
+ - both
859
+
860
+ # Supports --auto-correct
861
+ Style/EmptyLineBetweenDefs:
862
+ Description: Use empty lines between defs.
863
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
864
+ Enabled: false
865
+ AllowAdjacentOneLineDefs: false
866
+
867
+ # Supports --auto-correct
868
+ Style/EmptyLines:
869
+ Description: Don't use several empty lines in a row.
870
+ Enabled: false
871
+
872
+ # Supports --auto-correct
873
+ Style/EmptyLinesAroundAccessModifier:
874
+ Description: Keep blank lines around access modifiers.
875
+ Enabled: false
876
+
877
+ # Supports --auto-correct
878
+ Style/EmptyLinesAroundBlockBody:
879
+ Description: Keeps track of empty lines around block bodies.
880
+ Enabled: false
881
+ EnforcedStyle: no_empty_lines
882
+ SupportedStyles:
883
+ - empty_lines
884
+ - no_empty_lines
885
+
886
+ # Supports --auto-correct
887
+ Style/EmptyLinesAroundClassBody:
888
+ Description: Keeps track of empty lines around class bodies.
889
+ Enabled: false
890
+ EnforcedStyle: no_empty_lines
891
+ SupportedStyles:
892
+ - empty_lines
893
+ - no_empty_lines
894
+
895
+ # Supports --auto-correct
896
+ Style/EmptyLinesAroundMethodBody:
897
+ Description: Keeps track of empty lines around method bodies.
898
+ Enabled: false
899
+
900
+ # Supports --auto-correct
901
+ Style/EmptyLinesAroundModuleBody:
902
+ Description: Keeps track of empty lines around module bodies.
903
+ Enabled: false
904
+ EnforcedStyle: no_empty_lines
905
+ SupportedStyles:
906
+ - empty_lines
907
+ - no_empty_lines
908
+
909
+ # Supports --auto-correct
910
+ Style/EmptyLiteral:
911
+ Description: Prefer literals to Array.new/Hash.new/String.new.
912
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
913
+ Enabled: false
914
+
915
+ # Supports --auto-correct
916
+ Style/Encoding:
917
+ Description: Use UTF-8 as the source file encoding.
918
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
919
+ Enabled: false
920
+ EnforcedStyle: always
921
+ SupportedStyles:
922
+ - when_needed
923
+ - always
924
+ AutoCorrectEncodingComment: "# encoding: utf-8"
925
+
926
+ Style/EndBlock:
927
+ Description: Avoid the use of END blocks.
928
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
929
+ Enabled: false
930
+
931
+ Style/EndOfLine:
932
+ Description: Use Unix-style line endings.
933
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
934
+ Enabled: false
935
+
936
+ # Supports --auto-correct
937
+ Style/EvenOdd:
938
+ Description: Favor the use of Fixnum#even? && Fixnum#odd?
939
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
940
+ Enabled: false
941
+
942
+ # Supports --auto-correct
943
+ Style/ExtraSpacing:
944
+ Description: Do not use unnecessary spacing.
945
+ Enabled: false
946
+ AllowForAlignment: true
947
+ ForceEqualSignAlignment: false
948
+
949
+ Style/FileName:
950
+ Description: Use snake_case for source file names.
951
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
952
+ Enabled: false
953
+ Exclude: []
954
+ ExpectMatchingDefinition: false
955
+ Regex:
956
+ IgnoreExecutableScripts: true
957
+
958
+ # Supports --auto-correct
959
+ Style/FirstArrayElementLineBreak:
960
+ Description: Checks for a line break before the first element in a multi-line array.
961
+ Enabled: false
962
+
963
+ # Supports --auto-correct
964
+ Style/FirstHashElementLineBreak:
965
+ Description: Checks for a line break before the first element in a multi-line hash.
966
+ Enabled: false
967
+
968
+ # Supports --auto-correct
969
+ Style/FirstMethodArgumentLineBreak:
970
+ Description: Checks for a line break before the first argument in a multi-line method
971
+ call.
972
+ Enabled: false
973
+
974
+ # Supports --auto-correct
975
+ Style/FirstMethodParameterLineBreak:
976
+ Description: Checks for a line break before the first parameter in a multi-line method
977
+ parameter definition.
978
+ Enabled: false
979
+
980
+ # Supports --auto-correct
981
+ Style/FirstParameterIndentation:
982
+ Description: Checks the indentation of the first parameter in a method call.
983
+ Enabled: false
984
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
985
+ SupportedStyles:
986
+ - consistent
987
+ - special_for_inner_method_call
988
+ - special_for_inner_method_call_in_parentheses
989
+ IndentationWidth:
990
+
991
+ Style/FlipFlop:
992
+ Description: Checks for flip flops
993
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
994
+ Enabled: false
995
+
996
+ Style/For:
997
+ Description: Checks use of for or each in multiline loops.
998
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
999
+ Enabled: false
1000
+ EnforcedStyle: each
1001
+ SupportedStyles:
1002
+ - for
1003
+ - each
1004
+
1005
+ Style/FormatString:
1006
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
1007
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
1008
+ Enabled: false
1009
+ EnforcedStyle: format
1010
+ SupportedStyles:
1011
+ - format
1012
+ - sprintf
1013
+ - percent
1014
+
1015
+ # Supports --auto-correct
1016
+ Style/FrozenStringLiteralComment:
1017
+ Description: Add the frozen_string_literal comment to the top of files to help transition
1018
+ from Ruby 2.3.0 to Ruby 3.0.
1019
+ Enabled: false
1020
+ EnforcedStyle: when_needed
1021
+ SupportedStyles:
1022
+ - when_needed
1023
+ - always
1024
+
1025
+ Style/GlobalVars:
1026
+ Description: Do not introduce global variables.
1027
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
1028
+ Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html
1029
+ Enabled: false
1030
+ AllowedVariables: []
1031
+
1032
+ Style/GuardClause:
1033
+ Description: Check for conditionals that can be replaced with guard clauses
1034
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
1035
+ Enabled: false
1036
+ MinBodyLength: 1
1037
+
1038
+ # Supports --auto-correct
1039
+ Style/HashSyntax:
1040
+ Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1,
1041
+ :b => 2 }.'
1042
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
1043
+ Enabled: false
1044
+ EnforcedStyle: ruby19
1045
+ SupportedStyles:
1046
+ - ruby19
1047
+ - ruby19_no_mixed_keys
1048
+ - hash_rockets
1049
+ UseHashRocketsWithSymbolValues: false
1050
+
1051
+ Style/IdenticalConditionalBranches:
1052
+ Description: Checks that conditional statements do not have an identical line at the
1053
+ end of each branch, which can validly be moved out of the conditional.
1054
+ Enabled: false
1055
+
1056
+ Style/IfInsideElse:
1057
+ Description: Finds if nodes inside else, which can be converted to elsif.
1058
+ Enabled: false
1059
+
1060
+ # Supports --auto-correct
1061
+ Style/IfUnlessModifier:
1062
+ Description: Favor modifier if/unless usage when you have a single-line body.
1063
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
1064
+ Enabled: false
1065
+ MaxLineLength: 80
1066
+
1067
+ Style/IfWithSemicolon:
1068
+ Description: Do not use if x; .... Use the ternary operator instead.
1069
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
1070
+ Enabled: false
1071
+
1072
+ # Supports --auto-correct
1073
+ Style/IndentArray:
1074
+ Description: Checks the indentation of the first element in an array literal.
1075
+ Enabled: false
1076
+ EnforcedStyle: special_inside_parentheses
1077
+ SupportedStyles:
1078
+ - special_inside_parentheses
1079
+ - consistent
1080
+ - align_brackets
1081
+ IndentationWidth:
1082
+
1083
+ # Supports --auto-correct
1084
+ Style/IndentAssignment:
1085
+ Description: Checks the indentation of the first line of the right-hand-side of a
1086
+ multi-line assignment.
1087
+ Enabled: false
1088
+ IndentationWidth:
1089
+
1090
+ # Supports --auto-correct
1091
+ Style/IndentHash:
1092
+ Description: Checks the indentation of the first key in a hash literal.
1093
+ Enabled: false
1094
+ EnforcedStyle: special_inside_parentheses
1095
+ SupportedStyles:
1096
+ - special_inside_parentheses
1097
+ - consistent
1098
+ - align_braces
1099
+ IndentationWidth:
1100
+
1101
+ # Supports --auto-correct
1102
+ Style/IndentationConsistency:
1103
+ Description: Keep indentation straight.
1104
+ Enabled: false
1105
+ EnforcedStyle: normal
1106
+ SupportedStyles:
1107
+ - normal
1108
+ - rails
1109
+
1110
+ # Supports --auto-correct
1111
+ Style/IndentationWidth:
1112
+ Description: Use 2 spaces for indentation.
1113
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
1114
+ Enabled: false
1115
+ Width: 2
1116
+
1117
+ # Supports --auto-correct
1118
+ Style/InfiniteLoop:
1119
+ Description: Use Kernel#loop for infinite loops.
1120
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
1121
+ Enabled: false
1122
+
1123
+ # Supports --auto-correct
1124
+ Style/InitialIndentation:
1125
+ Description: Checks the indentation of the first non-blank non-comment line in a file.
1126
+ Enabled: false
1127
+
1128
+ Style/InlineComment:
1129
+ Description: Avoid inline comments.
1130
+ Enabled: false
1131
+
1132
+ # Supports --auto-correct
1133
+ Style/Lambda:
1134
+ Description: Use the new lambda literal syntax for single-line blocks.
1135
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
1136
+ Enabled: false
1137
+
1138
+ # Supports --auto-correct
1139
+ Style/LambdaCall:
1140
+ Description: Use lambda.call(...) instead of lambda.(...).
1141
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
1142
+ Enabled: false
1143
+ EnforcedStyle: call
1144
+ SupportedStyles:
1145
+ - call
1146
+ - braces
1147
+
1148
+ # Supports --auto-correct
1149
+ Style/LeadingCommentSpace:
1150
+ Description: Comments should start with a space.
1151
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
1152
+ Enabled: false
1153
+
1154
+ # Supports --auto-correct
1155
+ Style/LineEndConcatenation:
1156
+ Description: Use \ instead of + or << to concatenate two string literals at line end.
1157
+ Enabled: false
1158
+
1159
+ # Supports --auto-correct
1160
+ Style/MethodCallParentheses:
1161
+ Description: Do not use parentheses for method calls with no arguments.
1162
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
1163
+ Enabled: false
1164
+
1165
+ Style/MethodCalledOnDoEndBlock:
1166
+ Description: Avoid chaining a method call on a do...end block.
1167
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
1168
+ Enabled: false
1169
+
1170
+ # Supports --auto-correct
1171
+ Style/MethodDefParentheses:
1172
+ Description: Checks if the method definitions have or don't have parentheses.
1173
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
1174
+ Enabled: false
1175
+ EnforcedStyle: require_parentheses
1176
+ SupportedStyles:
1177
+ - require_parentheses
1178
+ - require_no_parentheses
1179
+ - require_no_parentheses_except_multiline
1180
+
1181
+ Style/MethodName:
1182
+ Description: Use the configured style when naming methods.
1183
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
1184
+ Enabled: false
1185
+ EnforcedStyle: snake_case
1186
+ SupportedStyles:
1187
+ - snake_case
1188
+ - camelCase
1189
+
1190
+ Style/MissingElse:
1191
+ Description: Require if/case expressions to have an else branches. If enabled, it
1192
+ is recommended that Style/UnlessElse and Style/EmptyElse be enabled. This will conflict
1193
+ with Style/EmptyElse if Style/EmptyElse is configured to style "both"
1194
+ Enabled: false
1195
+ EnforcedStyle: both
1196
+ SupportedStyles:
1197
+ - if
1198
+ - case
1199
+ - both
1200
+
1201
+ Style/ModuleFunction:
1202
+ Description: Checks for usage of `extend self` in modules.
1203
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
1204
+ Enabled: false
1205
+
1206
+ # Supports --auto-correct
1207
+ Style/MultilineArrayBraceLayout:
1208
+ Description: Checks that the closing brace in an array literal is symmetrical with
1209
+ respect to the opening brace and the array elements.
1210
+ Enabled: false
1211
+
1212
+ # Supports --auto-correct
1213
+ Style/MultilineAssignmentLayout:
1214
+ Description: Check for a newline after the assignment operator in multi-line assignments.
1215
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-conditional-assignment
1216
+ Enabled: false
1217
+ SupportedTypes:
1218
+ - block
1219
+ - case
1220
+ - class
1221
+ - if
1222
+ - kwbegin
1223
+ - module
1224
+ EnforcedStyle: new_line
1225
+ SupportedStyles:
1226
+ - same_line
1227
+ - new_line
1228
+
1229
+ Style/MultilineBlockChain:
1230
+ Description: Avoid multi-line chains of blocks.
1231
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
1232
+ Enabled: false
1233
+
1234
+ # Supports --auto-correct
1235
+ Style/MultilineBlockLayout:
1236
+ Description: Ensures newlines after multiline block do statements.
1237
+ Enabled: false
1238
+
1239
+ # Supports --auto-correct
1240
+ Style/MultilineIfThen:
1241
+ Description: Do not use then for multi-line if/unless.
1242
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
1243
+ Enabled: false
1244
+
1245
+ # Supports --auto-correct
1246
+ Style/MultilineMethodCallIndentation:
1247
+ Description: Checks indentation of method calls with the dot operator that span more
1248
+ than one line.
1249
+ Enabled: false
1250
+ EnforcedStyle: aligned
1251
+ SupportedStyles:
1252
+ - aligned
1253
+ - indented
1254
+ IndentationWidth:
1255
+
1256
+ # Supports --auto-correct
1257
+ Style/MultilineOperationIndentation:
1258
+ Description: Checks indentation of binary operations that span more than one line.
1259
+ Enabled: false
1260
+ EnforcedStyle: aligned
1261
+ SupportedStyles:
1262
+ - aligned
1263
+ - indented
1264
+ IndentationWidth:
1265
+
1266
+ Style/MultilineTernaryOperator:
1267
+ Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
1268
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
1269
+ Enabled: false
1270
+
1271
+ # Supports --auto-correct
1272
+ Style/MutableConstant:
1273
+ Description: Do not assign mutable objects to constants.
1274
+ Enabled: false
1275
+
1276
+ # Supports --auto-correct
1277
+ Style/NegatedIf:
1278
+ Description: Favor unless over if for negative conditions (or control flow or).
1279
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
1280
+ Enabled: false
1281
+
1282
+ # Supports --auto-correct
1283
+ Style/NegatedWhile:
1284
+ Description: Favor until over while for negative conditions.
1285
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
1286
+ Enabled: false
1287
+
1288
+ # Supports --auto-correct
1289
+ Style/NestedModifier:
1290
+ Description: Avoid using nested modifiers.
1291
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers
1292
+ Enabled: false
1293
+
1294
+ Style/NestedParenthesizedCalls:
1295
+ Description: Parenthesize method calls which are nested inside the argument list of
1296
+ another parenthesized method call.
1297
+ Enabled: false
1298
+
1299
+ Style/NestedTernaryOperator:
1300
+ Description: Use one expression per branch in a ternary operator.
1301
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
1302
+ Enabled: false
1303
+
1304
+ # Supports --auto-correct
1305
+ Style/Next:
1306
+ Description: Use `next` to skip iteration instead of a condition at the end.
1307
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
1308
+ Enabled: false
1309
+ EnforcedStyle: skip_modifier_ifs
1310
+ MinBodyLength: 3
1311
+ SupportedStyles:
1312
+ - skip_modifier_ifs
1313
+ - always
1314
+
1315
+ # Supports --auto-correct
1316
+ Style/NilComparison:
1317
+ Description: Prefer x.nil? to x == nil.
1318
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
1319
+ Enabled: false
1320
+
1321
+ # Supports --auto-correct
1322
+ Style/NonNilCheck:
1323
+ Description: Checks for redundant nil checks.
1324
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
1325
+ Enabled: false
1326
+ IncludeSemanticChanges: false
1327
+
1328
+ # Supports --auto-correct
1329
+ Style/Not:
1330
+ Description: Use ! instead of not.
1331
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
1332
+ Enabled: false
1333
+
1334
+ # Supports --auto-correct
1335
+ Style/NumericLiterals:
1336
+ Description: Add underscores to large numeric literals to improve their readability.
1337
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
1338
+ Enabled: false
1339
+ MinDigits: 5
1340
+
1341
+ Style/OneLineConditional:
1342
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
1343
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
1344
+ Enabled: false
1345
+
1346
+ Style/OpMethod:
1347
+ Description: When defining binary operators, name the argument other.
1348
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
1349
+ Enabled: false
1350
+
1351
+ Style/OptionHash:
1352
+ Description: Don't use option hashes when you can use keyword arguments.
1353
+ Enabled: false
1354
+ SuspiciousParamNames:
1355
+ - options
1356
+ - opts
1357
+ - args
1358
+ - params
1359
+ - parameters
1360
+
1361
+ Style/OptionalArguments:
1362
+ Description: Checks for optional arguments that do not appear at the end of the argument
1363
+ list
1364
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#optional-arguments
1365
+ Enabled: false
1366
+
1367
+ # Supports --auto-correct
1368
+ Style/ParallelAssignment:
1369
+ Description: Check for simple usages of parallel assignment. It will only warn when
1370
+ the number of variables matches on both sides of the assignment.
1371
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parallel-assignment
1372
+ Enabled: false
1373
+
1374
+ # Supports --auto-correct
1375
+ Style/ParenthesesAroundCondition:
1376
+ Description: Don't use parentheses around the condition of an if/unless/while.
1377
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
1378
+ Enabled: false
1379
+ AllowSafeAssignment: true
1380
+
1381
+ # Supports --auto-correct
1382
+ Style/PercentLiteralDelimiters:
1383
+ Description: Use `%`-literal delimiters consistently
1384
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
1385
+ Enabled: false
1386
+ PreferredDelimiters:
1387
+ "%": "()"
1388
+ "%i": "()"
1389
+ "%q": "()"
1390
+ "%Q": "()"
1391
+ "%r": "{}"
1392
+ "%s": "()"
1393
+ "%w": "()"
1394
+ "%W": "()"
1395
+ "%x": "()"
1396
+
1397
+ # Supports --auto-correct
1398
+ Style/PercentQLiterals:
1399
+ Description: Checks if uses of %Q/%q match the configured preference.
1400
+ Enabled: false
1401
+ EnforcedStyle: lower_case_q
1402
+ SupportedStyles:
1403
+ - lower_case_q
1404
+ - upper_case_q
1405
+
1406
+ # Supports --auto-correct
1407
+ Style/PerlBackrefs:
1408
+ Description: Avoid Perl-style regex back references.
1409
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
1410
+ Enabled: false
1411
+
1412
+ Style/PredicateName:
1413
+ Description: Check the names of predicate methods.
1414
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
1415
+ Enabled: false
1416
+ NamePrefix:
1417
+ - is_
1418
+ - has_
1419
+ - have_
1420
+ NamePrefixBlacklist:
1421
+ - is_
1422
+ - has_
1423
+ - have_
1424
+ NameWhitelist:
1425
+ - is_a?
1426
+
1427
+ # Supports --auto-correct
1428
+ Style/Proc:
1429
+ Description: Use proc instead of Proc.new.
1430
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
1431
+ Enabled: false
1432
+
1433
+ Style/RaiseArgs:
1434
+ Description: Checks the arguments passed to raise/fail.
1435
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
1436
+ Enabled: false
1437
+ EnforcedStyle: exploded
1438
+ SupportedStyles:
1439
+ - compact
1440
+ - exploded
1441
+
1442
+ # Supports --auto-correct
1443
+ Style/RedundantBegin:
1444
+ Description: Don't use begin blocks when they are not needed.
1445
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
1446
+ Enabled: false
1447
+
1448
+ # Supports --auto-correct
1449
+ Style/RedundantException:
1450
+ Description: Checks for an obsolete RuntimeException argument in raise/fail.
1451
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
1452
+ Enabled: false
1453
+
1454
+ # Supports --auto-correct
1455
+ Style/RedundantFreeze:
1456
+ Description: Checks usages of Object#freeze on immutable objects.
1457
+ Enabled: false
1458
+
1459
+ # Supports --auto-correct
1460
+ Style/RedundantParentheses:
1461
+ Description: Checks for parentheses that seem not to serve any purpose.
1462
+ Enabled: false
1463
+
1464
+ # Supports --auto-correct
1465
+ Style/RedundantReturn:
1466
+ Description: Don't use return where it's not required.
1467
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
1468
+ Enabled: false
1469
+ AllowMultipleReturnValues: false
1470
+
1471
+ # Supports --auto-correct
1472
+ Style/RedundantSelf:
1473
+ Description: Don't use self where it's not needed.
1474
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
1475
+ Enabled: false
1476
+
1477
+ # Supports --auto-correct
1478
+ Style/RegexpLiteral:
1479
+ Description: Use / or %r around regular expressions.
1480
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
1481
+ Enabled: false
1482
+ EnforcedStyle: slashes
1483
+ SupportedStyles:
1484
+ - slashes
1485
+ - percent_r
1486
+ - mixed
1487
+ AllowInnerSlashes: false
1488
+
1489
+ # Supports --auto-correct
1490
+ Style/RescueEnsureAlignment:
1491
+ Description: Align rescues and ensures correctly.
1492
+ Enabled: false
1493
+
1494
+ # Supports --auto-correct
1495
+ Style/RescueModifier:
1496
+ Description: Avoid using rescue in its modifier form.
1497
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
1498
+ Enabled: false
1499
+
1500
+ # Supports --auto-correct
1501
+ Style/SelfAssignment:
1502
+ Description: Checks for places where self-assignment shorthand should have been used.
1503
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
1504
+ Enabled: false
1505
+
1506
+ # Supports --auto-correct
1507
+ Style/Semicolon:
1508
+ Description: Don't use semicolons to terminate expressions.
1509
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
1510
+ Enabled: false
1511
+ AllowAsExpressionSeparator: false
1512
+
1513
+ Style/Send:
1514
+ Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
1515
+ may overlap with existing methods.
1516
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
1517
+ Enabled: false
1518
+
1519
+ # Supports --auto-correct
1520
+ Style/SignalException:
1521
+ Description: Checks for proper usage of fail and raise.
1522
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
1523
+ Enabled: false
1524
+ EnforcedStyle: semantic
1525
+ SupportedStyles:
1526
+ - only_raise
1527
+ - only_fail
1528
+ - semantic
1529
+
1530
+ Style/SingleLineBlockParams:
1531
+ Description: Enforces the names of some block params.
1532
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
1533
+ Enabled: false
1534
+ Methods:
1535
+ - reduce:
1536
+ - a
1537
+ - e
1538
+ - inject:
1539
+ - a
1540
+ - e
1541
+
1542
+ # Supports --auto-correct
1543
+ Style/SingleLineMethods:
1544
+ Description: Avoid single-line methods.
1545
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
1546
+ Enabled: false
1547
+ AllowIfMethodIsEmpty: true
1548
+
1549
+ # Supports --auto-correct
1550
+ Style/SpaceAfterColon:
1551
+ Description: Use spaces after colons.
1552
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
1553
+ Enabled: false
1554
+
1555
+ # Supports --auto-correct
1556
+ Style/SpaceAfterComma:
1557
+ Description: Use spaces after commas.
1558
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
1559
+ Enabled: false
1560
+
1561
+ # Supports --auto-correct
1562
+ Style/SpaceAfterControlKeyword:
1563
+ Description: Use spaces after if/elsif/unless/while/until/case/when.
1564
+ Enabled: false
1565
+
1566
+ # Supports --auto-correct
1567
+ Style/SpaceAfterMethodName:
1568
+ Description: Do not put a space between a method name and the opening parenthesis
1569
+ in a method definition.
1570
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
1571
+ Enabled: false
1572
+
1573
+ # Supports --auto-correct
1574
+ Style/SpaceAfterNot:
1575
+ Description: Tracks redundant space after the ! operator.
1576
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
1577
+ Enabled: false
1578
+
1579
+ # Supports --auto-correct
1580
+ Style/SpaceAfterSemicolon:
1581
+ Description: Use spaces after semicolons.
1582
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
1583
+ Enabled: false
1584
+
1585
+ # Supports --auto-correct
1586
+ Style/SpaceAroundBlockParameters:
1587
+ Description: Checks the spacing inside and after block parameters pipes.
1588
+ Enabled: false
1589
+ EnforcedStyleInsidePipes: no_space
1590
+ SupportedStyles:
1591
+ - space
1592
+ - no_space
1593
+
1594
+ # Supports --auto-correct
1595
+ Style/SpaceAroundEqualsInParameterDefault:
1596
+ Description: Checks that the equals signs in parameter default assignments have or
1597
+ don't have surrounding space depending on configuration.
1598
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
1599
+ Enabled: false
1600
+ EnforcedStyle: space
1601
+ SupportedStyles:
1602
+ - space
1603
+ - no_space
1604
+
1605
+ # Supports --auto-correct
1606
+ Style/SpaceAroundOperators:
1607
+ Description: Use a single space around operators.
1608
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
1609
+ Enabled: false
1610
+ AllowForAlignment: true
1611
+
1612
+ # Supports --auto-correct
1613
+ Style/SpaceBeforeBlockBraces:
1614
+ Description: Checks that the left block brace has or doesn't have space before it.
1615
+ Enabled: false
1616
+ EnforcedStyle: space
1617
+ SupportedStyles:
1618
+ - space
1619
+ - no_space
1620
+
1621
+ # Supports --auto-correct
1622
+ Style/SpaceBeforeComma:
1623
+ Description: No spaces before commas.
1624
+ Enabled: false
1625
+
1626
+ # Supports --auto-correct
1627
+ Style/SpaceBeforeComment:
1628
+ Description: Checks for missing space between code and a comment on the same line.
1629
+ Enabled: false
1630
+
1631
+ # Supports --auto-correct
1632
+ Style/SpaceBeforeFirstArg:
1633
+ Description: Checks that exactly one space is used between a method name and the first
1634
+ argument for method calls without parentheses.
1635
+ Enabled: false
1636
+ AllowForAlignment: true
1637
+
1638
+ # Supports --auto-correct
1639
+ Style/SpaceBeforeModifierKeyword:
1640
+ Description: Put a space before the modifier keyword.
1641
+ Enabled: false
1642
+
1643
+ # Supports --auto-correct
1644
+ Style/SpaceBeforeSemicolon:
1645
+ Description: No spaces before semicolons.
1646
+ Enabled: false
1647
+
1648
+ # Supports --auto-correct
1649
+ Style/SpaceInsideBlockBraces:
1650
+ Description: Checks that block braces have or don't have surrounding space. For blocks
1651
+ taking parameters, checks that the left brace has or doesn't have trailing space.
1652
+ Enabled: false
1653
+ EnforcedStyle: space
1654
+ SupportedStyles:
1655
+ - space
1656
+ - no_space
1657
+ EnforcedStyleForEmptyBraces: no_space
1658
+ SpaceBeforeBlockParameters: true
1659
+
1660
+ # Supports --auto-correct
1661
+ Style/SpaceInsideBrackets:
1662
+ Description: No spaces after [ or before ].
1663
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
1664
+ Enabled: false
1665
+
1666
+ # Supports --auto-correct
1667
+ Style/SpaceInsideHashLiteralBraces:
1668
+ Description: Use spaces inside hash literal braces - or don't.
1669
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
1670
+ Enabled: false
1671
+ EnforcedStyle: space
1672
+ EnforcedStyleForEmptyBraces: no_space
1673
+ SupportedStyles:
1674
+ - space
1675
+ - no_space
1676
+
1677
+ # Supports --auto-correct
1678
+ Style/SpaceInsideParens:
1679
+ Description: No spaces after ( or before ).
1680
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
1681
+ Enabled: false
1682
+
1683
+ # Supports --auto-correct
1684
+ Style/SpaceInsideRangeLiteral:
1685
+ Description: No spaces inside range literals.
1686
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
1687
+ Enabled: false
1688
+
1689
+ # Supports --auto-correct
1690
+ Style/SpaceInsideStringInterpolation:
1691
+ Description: Checks for padding/surrounding spaces inside string interpolation.
1692
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation
1693
+ Enabled: false
1694
+ EnforcedStyle: no_space
1695
+ SupportedStyles:
1696
+ - space
1697
+ - no_space
1698
+
1699
+ # Supports --auto-correct
1700
+ Style/SpecialGlobalVars:
1701
+ Description: Avoid Perl-style global variables.
1702
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
1703
+ Enabled: false
1704
+ EnforcedStyle: use_english_names
1705
+ SupportedStyles:
1706
+ - use_perl_names
1707
+ - use_english_names
1708
+
1709
+ # Supports --auto-correct
1710
+ Style/StabbyLambdaParentheses:
1711
+ Description: Check for the usage of parentheses around stabby lambda arguments.
1712
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args
1713
+ Enabled: false
1714
+ EnforcedStyle: require_parentheses
1715
+ SupportedStyles:
1716
+ - require_parentheses
1717
+ - require_no_parentheses
1718
+
1719
+ # Supports --auto-correct
1720
+ Style/StringLiterals:
1721
+ Description: Checks if uses of quotes match the configured preference.
1722
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
1723
+ Enabled: false
1724
+ EnforcedStyle: single_quotes
1725
+ SupportedStyles:
1726
+ - single_quotes
1727
+ - double_quotes
1728
+ ConsistentQuotesInMultiline: false
1729
+
1730
+ # Supports --auto-correct
1731
+ Style/StringLiteralsInInterpolation:
1732
+ Description: Checks if uses of quotes inside expressions in interpolated strings match
1733
+ the configured preference.
1734
+ Enabled: false
1735
+ EnforcedStyle: single_quotes
1736
+ SupportedStyles:
1737
+ - single_quotes
1738
+ - double_quotes
1739
+
1740
+ # Supports --auto-correct
1741
+ Style/StringMethods:
1742
+ Description: Checks if configured preferred methods are used over non-preferred.
1743
+ Enabled: false
1744
+ PreferredMethods:
1745
+ intern: to_sym
1746
+
1747
+ Style/StructInheritance:
1748
+ Description: Checks for inheritance from Struct.new.
1749
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
1750
+ Enabled: false
1751
+
1752
+ # Supports --auto-correct
1753
+ Style/SymbolArray:
1754
+ Description: Use %i or %I for arrays of symbols.
1755
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
1756
+ Enabled: false
27
1757
  EnforcedStyle: percent
28
- Lint/RescueException:
29
- Exclude:
30
- - 'exericises/**/*_test.rb'
1758
+ SupportedStyles:
1759
+ - percent
1760
+ - brackets
1761
+
1762
+ # Supports --auto-correct
1763
+ Style/SymbolLiteral:
1764
+ Description: Use plain symbols instead of string symbols when possible.
1765
+ Enabled: false
1766
+
1767
+ # Supports --auto-correct
1768
+ Style/SymbolProc:
1769
+ Description: Use symbols as procs instead of blocks when possible.
1770
+ Enabled: false
1771
+ IgnoredMethods:
1772
+ - respond_to
1773
+
1774
+ # Supports --auto-correct
1775
+ Style/Tab:
1776
+ Description: No hard tabs.
1777
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
1778
+ Enabled: false
1779
+
1780
+ # Supports --auto-correct
1781
+ Style/TrailingBlankLines:
1782
+ Description: Checks trailing blank lines and final newline.
1783
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
1784
+ Enabled: false
1785
+ EnforcedStyle: final_newline
1786
+ SupportedStyles:
1787
+ - final_newline
1788
+ - final_blank_line
1789
+
1790
+ # Supports --auto-correct
1791
+ Style/TrailingCommaInArguments:
1792
+ Description: Checks for trailing comma in argument lists.
1793
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
1794
+ Enabled: false
1795
+ EnforcedStyleForMultiline: no_comma
1796
+ SupportedStyles:
1797
+ - comma
1798
+ - consistent_comma
1799
+ - no_comma
1800
+
1801
+ # Supports --auto-correct
1802
+ Style/TrailingCommaInLiteral:
1803
+ Description: Checks for trailing comma in array and hash literals.
1804
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
1805
+ Enabled: false
1806
+ EnforcedStyleForMultiline: no_comma
1807
+ SupportedStyles:
1808
+ - comma
1809
+ - consistent_comma
1810
+ - no_comma
1811
+
1812
+ # Supports --auto-correct
1813
+ Style/TrailingUnderscoreVariable:
1814
+ Description: Checks for the usage of unneeded trailing underscores at the end of parallel
1815
+ variable assignment.
1816
+ AllowNamedUnderscoreVariables: true
1817
+ Enabled: false
1818
+
1819
+ # Supports --auto-correct
1820
+ Style/TrailingWhitespace:
1821
+ Description: Avoid trailing whitespace.
1822
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
1823
+ Enabled: false
1824
+
1825
+ # Supports --auto-correct
1826
+ Style/TrivialAccessors:
1827
+ Description: Prefer attr_* methods to trivial readers/writers.
1828
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
1829
+ Enabled: false
1830
+ ExactNameMatch: true
1831
+ AllowPredicates: false
1832
+ AllowDSLWriters: false
1833
+ IgnoreClassMethods: false
1834
+ Whitelist:
1835
+ - to_ary
1836
+ - to_a
1837
+ - to_c
1838
+ - to_enum
1839
+ - to_h
1840
+ - to_hash
1841
+ - to_i
1842
+ - to_int
1843
+ - to_io
1844
+ - to_open
1845
+ - to_path
1846
+ - to_proc
1847
+ - to_r
1848
+ - to_regexp
1849
+ - to_str
1850
+ - to_s
1851
+ - to_sym
1852
+
1853
+ Style/UnlessElse:
1854
+ Description: Do not use unless with else. Rewrite these with the positive case first.
1855
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
1856
+ Enabled: false
1857
+
1858
+ # Supports --auto-correct
1859
+ Style/UnneededCapitalW:
1860
+ Description: Checks for %W when interpolation is not needed.
1861
+ Enabled: false
1862
+
1863
+ # Supports --auto-correct
1864
+ Style/UnneededInterpolation:
1865
+ Description: Checks for strings that are just an interpolated expression.
1866
+ Enabled: false
1867
+
1868
+ # Supports --auto-correct
1869
+ Style/UnneededPercentQ:
1870
+ Description: Checks for %q/%Q when single quotes or double quotes would do.
1871
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
1872
+ Enabled: false
1873
+
1874
+ # Supports --auto-correct
1875
+ Style/VariableInterpolation:
1876
+ Description: Don't interpolate global, instance and class variables directly in strings.
1877
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
1878
+ Enabled: false
1879
+
1880
+ Style/VariableName:
1881
+ Description: Use the configured style when naming variables.
1882
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
1883
+ Enabled: false
1884
+ EnforcedStyle: snake_case
1885
+ SupportedStyles:
1886
+ - snake_case
1887
+ - camelCase
1888
+
1889
+ # Supports --auto-correct
1890
+ Style/WhenThen:
1891
+ Description: Use when x then ... for one-line cases.
1892
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
1893
+ Enabled: false
1894
+
1895
+ # Supports --auto-correct
1896
+ Style/WhileUntilDo:
1897
+ Description: Checks for redundant do after while or until.
1898
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
1899
+ Enabled: false
1900
+
1901
+ # Supports --auto-correct
1902
+ Style/WhileUntilModifier:
1903
+ Description: Favor modifier while/until usage when you have a single-line body.
1904
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
1905
+ Enabled: false
1906
+ MaxLineLength: 80
1907
+
1908
+ # Supports --auto-correct
1909
+ Style/WordArray:
1910
+ Description: Use %w or %W for arrays of words.
1911
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
1912
+ Enabled: false
1913
+ EnforcedStyle: percent
1914
+ SupportedStyles:
1915
+ - percent
1916
+ - brackets
1917
+ MinSize: 0
1918
+ WordRegex: !ruby/regexp /\A[\p{Word}\n\t]+\z/
1919
+