reek-rs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/Cargo.lock +614 -0
  3. data/Cargo.toml +24 -0
  4. data/DIVERGENCES.md +15 -0
  5. data/LICENSE +22 -0
  6. data/README.md +125 -0
  7. data/THIRD_PARTY_NOTICES.md +57 -0
  8. data/crates/reek-cli/Cargo.toml +22 -0
  9. data/crates/reek-cli/src/main.rs +277 -0
  10. data/crates/reek-core/Cargo.toml +21 -0
  11. data/crates/reek-core/src/ast.rs +449 -0
  12. data/crates/reek-core/src/code_comment.rs +245 -0
  13. data/crates/reek-core/src/comments.rs +179 -0
  14. data/crates/reek-core/src/config.rs +803 -0
  15. data/crates/reek-core/src/context.rs +891 -0
  16. data/crates/reek-core/src/detectors/attribute.rs +13 -0
  17. data/crates/reek-core/src/detectors/boolean_parameter.rs +20 -0
  18. data/crates/reek-core/src/detectors/class_variable.rs +25 -0
  19. data/crates/reek-core/src/detectors/control_parameter.rs +110 -0
  20. data/crates/reek-core/src/detectors/data_clump.rs +114 -0
  21. data/crates/reek-core/src/detectors/duplicate_method_call.rs +63 -0
  22. data/crates/reek-core/src/detectors/feature_envy.rs +32 -0
  23. data/crates/reek-core/src/detectors/instance_variable_assumption.rs +39 -0
  24. data/crates/reek-core/src/detectors/irresponsible_module.rs +12 -0
  25. data/crates/reek-core/src/detectors/long_parameter_list.rs +16 -0
  26. data/crates/reek-core/src/detectors/long_yield_list.rs +20 -0
  27. data/crates/reek-core/src/detectors/manual_dispatch.rs +18 -0
  28. data/crates/reek-core/src/detectors/missing_safe_method.rs +34 -0
  29. data/crates/reek-core/src/detectors/mod.rs +479 -0
  30. data/crates/reek-core/src/detectors/module_initialize.rs +15 -0
  31. data/crates/reek-core/src/detectors/nested_iterators.rs +82 -0
  32. data/crates/reek-core/src/detectors/nil_check.rs +40 -0
  33. data/crates/reek-core/src/detectors/repeated_conditional.rs +51 -0
  34. data/crates/reek-core/src/detectors/subclassed_from_core_class.rs +22 -0
  35. data/crates/reek-core/src/detectors/too_many_constants.rs +18 -0
  36. data/crates/reek-core/src/detectors/too_many_instance_variables.rs +25 -0
  37. data/crates/reek-core/src/detectors/too_many_methods.rs +15 -0
  38. data/crates/reek-core/src/detectors/too_many_statements.rs +16 -0
  39. data/crates/reek-core/src/detectors/uncommunicative_method_name.rs +32 -0
  40. data/crates/reek-core/src/detectors/uncommunicative_module_name.rs +33 -0
  41. data/crates/reek-core/src/detectors/uncommunicative_parameter_name.rs +49 -0
  42. data/crates/reek-core/src/detectors/uncommunicative_variable_name.rs +138 -0
  43. data/crates/reek-core/src/detectors/unused_parameters.rs +21 -0
  44. data/crates/reek-core/src/detectors/unused_private_method.rs +59 -0
  45. data/crates/reek-core/src/detectors/utility_function.rs +27 -0
  46. data/crates/reek-core/src/encodings.rs +180 -0
  47. data/crates/reek-core/src/examiner.rs +165 -0
  48. data/crates/reek-core/src/lib.rs +21 -0
  49. data/crates/reek-core/src/node.rs +423 -0
  50. data/crates/reek-core/src/ruby_format.rs +60 -0
  51. data/crates/reek-core/src/ruby_inspect.rs +172 -0
  52. data/crates/reek-core/src/ruby_regexp.rs +243 -0
  53. data/crates/reek-core/src/single_byte_encodings.rs +6007 -0
  54. data/crates/reek-core/src/source.rs +280 -0
  55. data/crates/reek-core/src/translate.rs +3112 -0
  56. data/crates/reek-core/src/yaml.rs +520 -0
  57. data/ext/reek_rs/Cargo.toml +18 -0
  58. data/ext/reek_rs/extconf.rb +6 -0
  59. data/ext/reek_rs/src/lib.rs +155 -0
  60. data/lib/reek_rs/version.rb +8 -0
  61. data/lib/reek_rs.rb +390 -0
  62. metadata +123 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1ecc0ee45d6950c1b0ebe7f72891293e54cae1ac42d13c3c990ab4205bebe81a
4
+ data.tar.gz: 7eeae177bdeccd6e2d6ecbfcade154bbd8565ee4e37434e8b8b34f3a692b5acb
5
+ SHA512:
6
+ metadata.gz: 3e97d34485529c26a735aaefbf5a68dc4a9142b29deefe7b78a3e9a117a76e7aee730c50e9fb78d2b0d609a6d5f145c5e54f5115ca526d62c7df882d02213889
7
+ data.tar.gz: 1a41c789e8a419896ec9f59ba0f72380c2a11d2ef58e67579f1457b76f9ea383887a248c8a341ee4137470061b538246575b2dbd0e2c304870535f516eda2ec9
data/Cargo.lock ADDED
@@ -0,0 +1,614 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.5"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "arraydeque"
16
+ version = "0.5.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236"
19
+
20
+ [[package]]
21
+ name = "bindgen"
22
+ version = "0.72.1"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
25
+ dependencies = [
26
+ "bitflags",
27
+ "cexpr",
28
+ "clang-sys",
29
+ "itertools",
30
+ "log",
31
+ "prettyplease",
32
+ "proc-macro2",
33
+ "quote",
34
+ "regex",
35
+ "rustc-hash",
36
+ "shlex 1.3.0",
37
+ "syn 2.0.119",
38
+ ]
39
+
40
+ [[package]]
41
+ name = "bitflags"
42
+ version = "2.13.2"
43
+ source = "registry+https://github.com/rust-lang/crates.io-index"
44
+ checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
45
+
46
+ [[package]]
47
+ name = "cc"
48
+ version = "1.13.0"
49
+ source = "registry+https://github.com/rust-lang/crates.io-index"
50
+ checksum = "53b4e5299ae8fd0d9e848f3efafd5b4feed729b8c731df9d62375cb1efdc3f4e"
51
+ dependencies = [
52
+ "find-msvc-tools",
53
+ "shlex 2.0.1",
54
+ ]
55
+
56
+ [[package]]
57
+ name = "cexpr"
58
+ version = "0.6.0"
59
+ source = "registry+https://github.com/rust-lang/crates.io-index"
60
+ checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
61
+ dependencies = [
62
+ "nom",
63
+ ]
64
+
65
+ [[package]]
66
+ name = "cfg-if"
67
+ version = "1.0.5"
68
+ source = "registry+https://github.com/rust-lang/crates.io-index"
69
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
70
+
71
+ [[package]]
72
+ name = "clang-sys"
73
+ version = "1.9.1"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a"
76
+ dependencies = [
77
+ "glob",
78
+ "libc",
79
+ "libloading",
80
+ ]
81
+
82
+ [[package]]
83
+ name = "core_detect"
84
+ version = "1.0.0"
85
+ source = "registry+https://github.com/rust-lang/crates.io-index"
86
+ checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"
87
+
88
+ [[package]]
89
+ name = "crossbeam-deque"
90
+ version = "0.8.8"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
93
+ dependencies = [
94
+ "crossbeam-epoch",
95
+ "crossbeam-utils",
96
+ ]
97
+
98
+ [[package]]
99
+ name = "crossbeam-epoch"
100
+ version = "0.9.21"
101
+ source = "registry+https://github.com/rust-lang/crates.io-index"
102
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
103
+ dependencies = [
104
+ "crossbeam-utils",
105
+ ]
106
+
107
+ [[package]]
108
+ name = "crossbeam-utils"
109
+ version = "0.8.23"
110
+ source = "registry+https://github.com/rust-lang/crates.io-index"
111
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
112
+
113
+ [[package]]
114
+ name = "either"
115
+ version = "1.19.0"
116
+ source = "registry+https://github.com/rust-lang/crates.io-index"
117
+ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
118
+
119
+ [[package]]
120
+ name = "encoding_rs"
121
+ version = "0.8.44"
122
+ source = "registry+https://github.com/rust-lang/crates.io-index"
123
+ checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5"
124
+ dependencies = [
125
+ "cfg-if",
126
+ "core_detect",
127
+ "multiversion_no_op",
128
+ "rustversion",
129
+ "scopeguard",
130
+ "simdutf8",
131
+ ]
132
+
133
+ [[package]]
134
+ name = "equivalent"
135
+ version = "1.0.3"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
138
+
139
+ [[package]]
140
+ name = "find-msvc-tools"
141
+ version = "0.1.17"
142
+ source = "registry+https://github.com/rust-lang/crates.io-index"
143
+ checksum = "f35b0b9b788e7109a8eb0607f5c8a13495edee3ef8e246f60f0664a7cd25b277"
144
+
145
+ [[package]]
146
+ name = "foldhash"
147
+ version = "0.2.0"
148
+ source = "registry+https://github.com/rust-lang/crates.io-index"
149
+ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
150
+
151
+ [[package]]
152
+ name = "glob"
153
+ version = "0.3.4"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
156
+
157
+ [[package]]
158
+ name = "hashbrown"
159
+ version = "0.17.2"
160
+ source = "registry+https://github.com/rust-lang/crates.io-index"
161
+ checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc"
162
+ dependencies = [
163
+ "foldhash",
164
+ ]
165
+
166
+ [[package]]
167
+ name = "hashlink"
168
+ version = "0.12.2"
169
+ source = "registry+https://github.com/rust-lang/crates.io-index"
170
+ checksum = "a596f1b20ed2cc5ecac41a164aaebc7258057060f06c0cf7a2ba3991ee7990fb"
171
+ dependencies = [
172
+ "hashbrown",
173
+ ]
174
+
175
+ [[package]]
176
+ name = "indexmap"
177
+ version = "2.14.2"
178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
179
+ checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
180
+ dependencies = [
181
+ "equivalent",
182
+ "hashbrown",
183
+ ]
184
+
185
+ [[package]]
186
+ name = "itertools"
187
+ version = "0.13.0"
188
+ source = "registry+https://github.com/rust-lang/crates.io-index"
189
+ checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
190
+ dependencies = [
191
+ "either",
192
+ ]
193
+
194
+ [[package]]
195
+ name = "itoa"
196
+ version = "1.0.19"
197
+ source = "registry+https://github.com/rust-lang/crates.io-index"
198
+ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
199
+
200
+ [[package]]
201
+ name = "lazy_static"
202
+ version = "1.5.1"
203
+ source = "registry+https://github.com/rust-lang/crates.io-index"
204
+ checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
205
+
206
+ [[package]]
207
+ name = "libc"
208
+ version = "0.2.191"
209
+ source = "registry+https://github.com/rust-lang/crates.io-index"
210
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
211
+
212
+ [[package]]
213
+ name = "libloading"
214
+ version = "0.8.9"
215
+ source = "registry+https://github.com/rust-lang/crates.io-index"
216
+ checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
217
+ dependencies = [
218
+ "cfg-if",
219
+ "windows-link",
220
+ ]
221
+
222
+ [[package]]
223
+ name = "log"
224
+ version = "0.4.35"
225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
226
+ checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"
227
+
228
+ [[package]]
229
+ name = "magnus"
230
+ version = "0.9.4"
231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
232
+ checksum = "3c5f2dd2017d172e2fde9969a35f10f1374a4dd79b37a17f1847f83201883de7"
233
+ dependencies = [
234
+ "magnus-macros",
235
+ "rb-sys",
236
+ "rb-sys-env",
237
+ "seq-macro",
238
+ ]
239
+
240
+ [[package]]
241
+ name = "magnus-macros"
242
+ version = "0.9.1"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "9dafde2eeb66f090e0f326112323eb8324b12cb32b5d1210e541d3df6b0ce77e"
245
+ dependencies = [
246
+ "proc-macro2",
247
+ "quote",
248
+ "syn 2.0.119",
249
+ ]
250
+
251
+ [[package]]
252
+ name = "memchr"
253
+ version = "2.8.3"
254
+ source = "registry+https://github.com/rust-lang/crates.io-index"
255
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
256
+
257
+ [[package]]
258
+ name = "minimal-lexical"
259
+ version = "0.2.1"
260
+ source = "registry+https://github.com/rust-lang/crates.io-index"
261
+ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
262
+
263
+ [[package]]
264
+ name = "multiversion_no_op"
265
+ version = "1.0.0"
266
+ source = "registry+https://github.com/rust-lang/crates.io-index"
267
+ checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d"
268
+
269
+ [[package]]
270
+ name = "nom"
271
+ version = "7.1.3"
272
+ source = "registry+https://github.com/rust-lang/crates.io-index"
273
+ checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
274
+ dependencies = [
275
+ "memchr",
276
+ "minimal-lexical",
277
+ ]
278
+
279
+ [[package]]
280
+ name = "once_cell"
281
+ version = "1.21.4"
282
+ source = "registry+https://github.com/rust-lang/crates.io-index"
283
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
284
+
285
+ [[package]]
286
+ name = "onig"
287
+ version = "6.5.3"
288
+ source = "registry+https://github.com/rust-lang/crates.io-index"
289
+ checksum = "0cc3cbf698f9438986c11a880c90a6d04b9de27575afd28bbf45b154b6c709e2"
290
+ dependencies = [
291
+ "bitflags",
292
+ "libc",
293
+ "once_cell",
294
+ "onig_sys",
295
+ ]
296
+
297
+ [[package]]
298
+ name = "onig_sys"
299
+ version = "69.9.3"
300
+ source = "registry+https://github.com/rust-lang/crates.io-index"
301
+ checksum = "1e68317604e77e53b85896388e1a803c1d21b74c899ec9e5e1112db90735edd7"
302
+ dependencies = [
303
+ "bindgen",
304
+ "cc",
305
+ "pkg-config",
306
+ ]
307
+
308
+ [[package]]
309
+ name = "pkg-config"
310
+ version = "0.3.34"
311
+ source = "registry+https://github.com/rust-lang/crates.io-index"
312
+ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
313
+
314
+ [[package]]
315
+ name = "prettyplease"
316
+ version = "0.2.37"
317
+ source = "registry+https://github.com/rust-lang/crates.io-index"
318
+ checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
319
+ dependencies = [
320
+ "proc-macro2",
321
+ "syn 2.0.119",
322
+ ]
323
+
324
+ [[package]]
325
+ name = "proc-macro2"
326
+ version = "1.0.107"
327
+ source = "registry+https://github.com/rust-lang/crates.io-index"
328
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
329
+ dependencies = [
330
+ "unicode-ident",
331
+ ]
332
+
333
+ [[package]]
334
+ name = "quote"
335
+ version = "1.0.47"
336
+ source = "registry+https://github.com/rust-lang/crates.io-index"
337
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
338
+ dependencies = [
339
+ "proc-macro2",
340
+ ]
341
+
342
+ [[package]]
343
+ name = "rayon"
344
+ version = "1.12.0"
345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
346
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
347
+ dependencies = [
348
+ "either",
349
+ "rayon-core",
350
+ ]
351
+
352
+ [[package]]
353
+ name = "rayon-core"
354
+ version = "1.13.0"
355
+ source = "registry+https://github.com/rust-lang/crates.io-index"
356
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
357
+ dependencies = [
358
+ "crossbeam-deque",
359
+ "crossbeam-utils",
360
+ ]
361
+
362
+ [[package]]
363
+ name = "rb-sys"
364
+ version = "0.9.130"
365
+ source = "registry+https://github.com/rust-lang/crates.io-index"
366
+ checksum = "02faf625bb10ba893e3ae620f19c9fb1b5f8fcae0fe4eb86bb3f2230fad75edb"
367
+ dependencies = [
368
+ "rb-sys-build",
369
+ ]
370
+
371
+ [[package]]
372
+ name = "rb-sys-build"
373
+ version = "0.9.130"
374
+ source = "registry+https://github.com/rust-lang/crates.io-index"
375
+ checksum = "05be6f9c86fe5482808162826f6c047d093b3670582296c770de1d94f8066694"
376
+ dependencies = [
377
+ "bindgen",
378
+ "lazy_static",
379
+ "proc-macro2",
380
+ "quote",
381
+ "regex",
382
+ "shell-words",
383
+ "syn 2.0.119",
384
+ ]
385
+
386
+ [[package]]
387
+ name = "rb-sys-env"
388
+ version = "0.2.3"
389
+ source = "registry+https://github.com/rust-lang/crates.io-index"
390
+ checksum = "cca7ad6a7e21e72151d56fe2495a259b5670e204c3adac41ee7ef676ea08117a"
391
+
392
+ [[package]]
393
+ name = "reek-cli"
394
+ version = "0.1.0"
395
+ dependencies = [
396
+ "rayon",
397
+ "reek-core",
398
+ "serde_json",
399
+ ]
400
+
401
+ [[package]]
402
+ name = "reek-core"
403
+ version = "0.1.0"
404
+ dependencies = [
405
+ "encoding_rs",
406
+ "indexmap",
407
+ "onig",
408
+ "onig_sys",
409
+ "ruby-prism",
410
+ "yaml-rust2",
411
+ ]
412
+
413
+ [[package]]
414
+ name = "reek_rs"
415
+ version = "0.1.0"
416
+ dependencies = [
417
+ "magnus",
418
+ "rayon",
419
+ "reek-core",
420
+ ]
421
+
422
+ [[package]]
423
+ name = "regex"
424
+ version = "1.13.2"
425
+ source = "registry+https://github.com/rust-lang/crates.io-index"
426
+ checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857"
427
+ dependencies = [
428
+ "aho-corasick",
429
+ "memchr",
430
+ "regex-automata",
431
+ "regex-syntax",
432
+ ]
433
+
434
+ [[package]]
435
+ name = "regex-automata"
436
+ version = "0.4.19"
437
+ source = "registry+https://github.com/rust-lang/crates.io-index"
438
+ checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158"
439
+ dependencies = [
440
+ "aho-corasick",
441
+ "memchr",
442
+ "regex-syntax",
443
+ ]
444
+
445
+ [[package]]
446
+ name = "regex-syntax"
447
+ version = "0.8.12"
448
+ source = "registry+https://github.com/rust-lang/crates.io-index"
449
+ checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6"
450
+
451
+ [[package]]
452
+ name = "ruby-prism"
453
+ version = "2.1.0"
454
+ source = "registry+https://github.com/rust-lang/crates.io-index"
455
+ checksum = "ef9dd23fe10d6335d390c9fd23cf7dac83f594be5676ad28de58d6f2bac65f4c"
456
+ dependencies = [
457
+ "ruby-prism-sys",
458
+ "serde",
459
+ "serde_json",
460
+ ]
461
+
462
+ [[package]]
463
+ name = "ruby-prism-sys"
464
+ version = "2.1.0"
465
+ source = "registry+https://github.com/rust-lang/crates.io-index"
466
+ checksum = "f3e6b1801eb164c6b2c6c6cd42e55bf61d73f973719f675370769ce0295ba7f1"
467
+ dependencies = [
468
+ "cc",
469
+ "shlex 2.0.1",
470
+ ]
471
+
472
+ [[package]]
473
+ name = "rustc-hash"
474
+ version = "2.1.4"
475
+ source = "registry+https://github.com/rust-lang/crates.io-index"
476
+ checksum = "ca420ddf5554e546a707e0ecb8bd311d505ee00b40982a7064b8bdc48aa59336"
477
+
478
+ [[package]]
479
+ name = "rustversion"
480
+ version = "1.0.23"
481
+ source = "registry+https://github.com/rust-lang/crates.io-index"
482
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
483
+
484
+ [[package]]
485
+ name = "scopeguard"
486
+ version = "1.2.0"
487
+ source = "registry+https://github.com/rust-lang/crates.io-index"
488
+ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
489
+
490
+ [[package]]
491
+ name = "seq-macro"
492
+ version = "0.3.6"
493
+ source = "registry+https://github.com/rust-lang/crates.io-index"
494
+ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
495
+
496
+ [[package]]
497
+ name = "serde"
498
+ version = "1.0.229"
499
+ source = "registry+https://github.com/rust-lang/crates.io-index"
500
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
501
+ dependencies = [
502
+ "serde_core",
503
+ "serde_derive",
504
+ ]
505
+
506
+ [[package]]
507
+ name = "serde_core"
508
+ version = "1.0.229"
509
+ source = "registry+https://github.com/rust-lang/crates.io-index"
510
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
511
+ dependencies = [
512
+ "serde_derive",
513
+ ]
514
+
515
+ [[package]]
516
+ name = "serde_derive"
517
+ version = "1.0.229"
518
+ source = "registry+https://github.com/rust-lang/crates.io-index"
519
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
520
+ dependencies = [
521
+ "proc-macro2",
522
+ "quote",
523
+ "syn 3.0.10",
524
+ ]
525
+
526
+ [[package]]
527
+ name = "serde_json"
528
+ version = "1.0.154"
529
+ source = "registry+https://github.com/rust-lang/crates.io-index"
530
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
531
+ dependencies = [
532
+ "foldhash",
533
+ "indexmap",
534
+ "itoa",
535
+ "memchr",
536
+ "serde",
537
+ "serde_core",
538
+ "zmij",
539
+ ]
540
+
541
+ [[package]]
542
+ name = "shell-words"
543
+ version = "1.1.1"
544
+ source = "registry+https://github.com/rust-lang/crates.io-index"
545
+ checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
546
+
547
+ [[package]]
548
+ name = "shlex"
549
+ version = "1.3.0"
550
+ source = "registry+https://github.com/rust-lang/crates.io-index"
551
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
552
+
553
+ [[package]]
554
+ name = "shlex"
555
+ version = "2.0.1"
556
+ source = "registry+https://github.com/rust-lang/crates.io-index"
557
+ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
558
+
559
+ [[package]]
560
+ name = "simdutf8"
561
+ version = "0.1.5"
562
+ source = "registry+https://github.com/rust-lang/crates.io-index"
563
+ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
564
+
565
+ [[package]]
566
+ name = "syn"
567
+ version = "2.0.119"
568
+ source = "registry+https://github.com/rust-lang/crates.io-index"
569
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
570
+ dependencies = [
571
+ "proc-macro2",
572
+ "quote",
573
+ "unicode-ident",
574
+ ]
575
+
576
+ [[package]]
577
+ name = "syn"
578
+ version = "3.0.10"
579
+ source = "registry+https://github.com/rust-lang/crates.io-index"
580
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
581
+ dependencies = [
582
+ "proc-macro2",
583
+ "quote",
584
+ "unicode-ident",
585
+ ]
586
+
587
+ [[package]]
588
+ name = "unicode-ident"
589
+ version = "1.0.27"
590
+ source = "registry+https://github.com/rust-lang/crates.io-index"
591
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
592
+
593
+ [[package]]
594
+ name = "windows-link"
595
+ version = "0.2.1"
596
+ source = "registry+https://github.com/rust-lang/crates.io-index"
597
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
598
+
599
+ [[package]]
600
+ name = "yaml-rust2"
601
+ version = "0.13.2"
602
+ source = "registry+https://github.com/rust-lang/crates.io-index"
603
+ checksum = "4a8af4469040402b7fe43c26575bab9a3069f0717c4a2931ecf4fb8728ee4cec"
604
+ dependencies = [
605
+ "arraydeque",
606
+ "encoding_rs",
607
+ "hashlink",
608
+ ]
609
+
610
+ [[package]]
611
+ name = "zmij"
612
+ version = "1.0.23"
613
+ source = "registry+https://github.com/rust-lang/crates.io-index"
614
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
data/Cargo.toml ADDED
@@ -0,0 +1,24 @@
1
+ [workspace]
2
+ resolver = "2"
3
+ members = ["crates/reek-core", "crates/reek-cli", "ext/reek_rs"]
4
+
5
+ [workspace.package]
6
+ version = "0.1.0"
7
+ edition = "2021"
8
+ rust-version = "1.88" # encoding_rs 0.8.44 requires 1.88
9
+ license = "MIT"
10
+ authors = ["Eric Burns"]
11
+ homepage = "https://gloom.fm"
12
+ repository = "https://github.com/gloom-fm/reek-rs"
13
+
14
+ [workspace.dependencies]
15
+ ruby-prism = "=2.1.0"
16
+ indexmap = "2"
17
+ rayon = "1"
18
+ onig = { version = "6.5", default-features = false }
19
+ yaml-rust2 = "0.13"
20
+ serde_json = { version = "1.0.154", features = ["preserve_order"] }
21
+
22
+ [profile.release]
23
+ lto = true
24
+ codegen-units = 1
data/DIVERGENCES.md ADDED
@@ -0,0 +1,15 @@
1
+ # Known differences from Reek 6.5.0
2
+
3
+ Each item below was reproduced against Reek 6.5.0 (parser 3.3.14.0, Ruby
4
+ 3.3).
5
+
6
+ | Difference | Reek 6.5.0 | ReekRs |
7
+ | --- | --- | --- |
8
+ | Identifiers that start with a non-ASCII uppercase letter (`Été`) | The parser gem's lexer starts constants only with `A`-`Z`, so `Été` is a method call or local variable, and `class Été; end` is a `SyntaxError`. | Prism reads `Été` as a constant, as Ruby does: `class Été; end` is examined, and `Été = 1` inside a method is a `SyntaxError` ("dynamic constant assignment"). |
9
+ | `/\u00e9/n` (a `\u` escape in a regexp with the `n` flag) | The parser gem accepts it. | `SyntaxError`, as Ruby and Prism reject it. |
10
+ | `/\u00e9\C-d\M-a/n` (`\u` mixed with meta escapes in an `n` regexp) | `EncodingError` | `SyntaxError` |
11
+ | `:reek:String`, `:reek:Object` or another top-level constant that is not a detector, in a source comment | `SmellDetectors.const_get` finds the constant, and calling `configuration_keys` on it raises `NoMethodError`, reported as `IncomprehensibleSourceError`. Which names do this depends on the constants loaded in the process. | `BadDetectorInCommentError`, as for any other name that is not a detector. |
12
+ | Multibyte magic-comment encodings (Shift_JIS, Windows-31J, EUC-JP, GBK, GB18030, Big5, EUC-KR) | Ruby's transcoding tables. | The WHATWG Encoding Standard's tables (encoding_rs). Where they map a byte sequence differently, names and messages differ, or one side raises `EncodingError` and the other does not. Single-byte encodings use Ruby's own tables and match. |
13
+ | Other multibyte magic-comment encodings (CP949, Big5-HKSCS, EUC-TW, GB2312, eucJP-ms, CP51932, and so on) | Transcoded to UTF-8 and examined. | `IncomprehensibleSourceError`, whose cause names the encoding. |
14
+ | Message of a `ConfigFileError` for a `.reek.yml` that is not valid YAML | Ends with libyaml's description, e.g. `did not find expected node content while parsing a flow node at line 2 column 1`. | Same class and message prefix; the description is yaml-rust2's, e.g. `while parsing a node, did not find expected node content at byte 13 line 2 column 1`. |
15
+ | `long_message` of `SyntaxError`, `EncodingError` and `IncomprehensibleSourceError` raised from Rust | The cause is the parser gem's or Ruby's exception, with its backtrace. | The cause is a `RuntimeError` without a backtrace, holding Prism's first error message (`SyntaxError`), the reason (`IncomprehensibleSourceError`), or nothing (`EncodingError`, whose `long_message` shows `nil`). Errors raised while reading the source in Ruby keep the original exception. |
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) Eric Burns, gloom.fm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.