ast-grep-cli 0.36.0__tar.gz → 0.36.2__tar.gz

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 (115) hide show
  1. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/Cargo.lock +54 -73
  2. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/Cargo.toml +6 -6
  3. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/PKG-INFO +1 -1
  4. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/Cargo.toml +1 -0
  5. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print/test.rs +46 -26
  6. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print.rs +31 -15
  7. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/run.rs +37 -25
  8. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/scan.rs +3 -4
  9. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/args.rs +29 -37
  10. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/debug_query.rs +4 -4
  11. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/mod.rs +19 -22
  12. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/worker.rs +2 -5
  13. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/Cargo.toml +1 -1
  14. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/combined.rs +4 -2
  15. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/lib.rs +1 -1
  16. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/deserialize_env.rs +1 -0
  17. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/nth_child.rs +2 -1
  18. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/range.rs +1 -0
  19. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/Cargo.toml +1 -1
  20. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/language.rs +1 -1
  21. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/kind.rs +1 -0
  22. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/pattern.rs +1 -0
  23. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher.rs +12 -14
  24. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/node.rs +14 -17
  25. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/ops.rs +1 -0
  26. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/traversal.rs +1 -1
  27. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/Cargo.toml +1 -1
  28. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/lib.rs +1 -1
  29. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/pyproject.toml +1 -1
  30. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/LICENSE +0 -0
  31. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/README.md +0 -0
  32. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/README.md +0 -0
  33. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/bin/alias.rs +0 -0
  34. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/completions.rs +0 -0
  35. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/config.rs +0 -0
  36. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lang/injection.rs +0 -0
  37. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lang/lang_globs.rs +0 -0
  38. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lang/mod.rs +0 -0
  39. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lib.rs +0 -0
  40. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lsp.rs +0 -0
  41. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/main.rs +0 -0
  42. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/new.rs +0 -0
  43. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/cloud_print.rs +0 -0
  44. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print/match_merger.rs +0 -0
  45. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print/styles.rs +0 -0
  46. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/interactive_print.rs +0 -0
  47. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/json_print.rs +0 -0
  48. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/mod.rs +0 -0
  49. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/error_context.rs +0 -0
  50. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/inspect.rs +0 -0
  51. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/print_diff.rs +0 -0
  52. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/rule_overwrite.rs +0 -0
  53. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/case_result.rs +0 -0
  54. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/find_file.rs +0 -0
  55. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/reporter.rs +0 -0
  56. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/snapshot.rs +0 -0
  57. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/test_case.rs +0 -0
  58. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify.rs +0 -0
  59. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/common/mod.rs +0 -0
  60. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/run_test.rs +0 -0
  61. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/scan_test.rs +0 -0
  62. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/verify_test.rs +0 -0
  63. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/check_var.rs +0 -0
  64. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/fixer.rs +0 -0
  65. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/maybe.rs +0 -0
  66. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/mod.rs +0 -0
  67. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/referent_rule.rs +0 -0
  68. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/relational_rule.rs +0 -0
  69. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/stop_by.rs +0 -0
  70. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule_collection.rs +0 -0
  71. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule_config.rs +0 -0
  72. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule_core.rs +0 -0
  73. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/mod.rs +0 -0
  74. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/rewrite.rs +0 -0
  75. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/string_case.rs +0 -0
  76. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/transformation.rs +0 -0
  77. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/lib.rs +0 -0
  78. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/match_tree/match_node.rs +0 -0
  79. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/match_tree/mod.rs +0 -0
  80. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/match_tree/strictness.rs +0 -0
  81. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/node_match.rs +0 -0
  82. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/text.rs +0 -0
  83. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/meta_var.rs +0 -0
  84. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/pinned.rs +0 -0
  85. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer/indent.rs +0 -0
  86. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer/structural.rs +0 -0
  87. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer/template.rs +0 -0
  88. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer.rs +0 -0
  89. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/source.rs +0 -0
  90. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/dynamic/Cargo.toml +0 -0
  91. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/dynamic/src/custom_lang.rs +0 -0
  92. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/dynamic/src/lib.rs +0 -0
  93. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/bash.rs +0 -0
  94. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/cpp.rs +0 -0
  95. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/csharp.rs +0 -0
  96. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/css.rs +0 -0
  97. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/elixir.rs +0 -0
  98. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/go.rs +0 -0
  99. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/haskell.rs +0 -0
  100. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/html.rs +0 -0
  101. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/json.rs +0 -0
  102. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/kotlin.rs +0 -0
  103. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/lua.rs +0 -0
  104. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/parsers.rs +0 -0
  105. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/php.rs +0 -0
  106. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/python.rs +0 -0
  107. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/ruby.rs +0 -0
  108. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/rust.rs +0 -0
  109. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/scala.rs +0 -0
  110. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/swift.rs +0 -0
  111. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/yaml.rs +0 -0
  112. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/Cargo.toml +0 -0
  113. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/src/lib.rs +0 -0
  114. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/src/utils.rs +0 -0
  115. {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/tests/basic.rs +0 -0
@@ -92,9 +92,9 @@ dependencies = [
92
92
 
93
93
  [[package]]
94
94
  name = "anyhow"
95
- version = "1.0.96"
95
+ version = "1.0.97"
96
96
  source = "registry+https://github.com/rust-lang/crates.io-index"
97
- checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4"
97
+ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
98
98
 
99
99
  [[package]]
100
100
  name = "assert_cmd"
@@ -114,7 +114,7 @@ dependencies = [
114
114
 
115
115
  [[package]]
116
116
  name = "ast-grep"
117
- version = "0.36.0"
117
+ version = "0.36.2"
118
118
  dependencies = [
119
119
  "ansi_term",
120
120
  "anyhow",
@@ -137,6 +137,7 @@ dependencies = [
137
137
  "serde_json",
138
138
  "serde_yaml",
139
139
  "similar",
140
+ "smallvec",
140
141
  "tempfile",
141
142
  "tokio",
142
143
  "tree-sitter-facade-sg",
@@ -144,7 +145,7 @@ dependencies = [
144
145
 
145
146
  [[package]]
146
147
  name = "ast-grep-config"
147
- version = "0.36.0"
148
+ version = "0.36.2"
148
149
  dependencies = [
149
150
  "anyhow",
150
151
  "ast-grep-core",
@@ -155,23 +156,23 @@ dependencies = [
155
156
  "serde",
156
157
  "serde_yaml",
157
158
  "thiserror",
158
- "tree-sitter-typescript 0.21.2",
159
+ "tree-sitter-typescript",
159
160
  ]
160
161
 
161
162
  [[package]]
162
163
  name = "ast-grep-core"
163
- version = "0.36.0"
164
+ version = "0.36.2"
164
165
  dependencies = [
165
166
  "bit-set",
166
167
  "regex",
167
168
  "thiserror",
168
169
  "tree-sitter-facade-sg",
169
- "tree-sitter-typescript 0.21.2",
170
+ "tree-sitter-typescript",
170
171
  ]
171
172
 
172
173
  [[package]]
173
174
  name = "ast-grep-dynamic"
174
- version = "0.36.0"
175
+ version = "0.36.2"
175
176
  dependencies = [
176
177
  "ast-grep-core",
177
178
  "ignore",
@@ -184,7 +185,7 @@ dependencies = [
184
185
 
185
186
  [[package]]
186
187
  name = "ast-grep-language"
187
- version = "0.36.0"
188
+ version = "0.36.2"
188
189
  dependencies = [
189
190
  "ast-grep-core",
190
191
  "ignore",
@@ -209,13 +210,13 @@ dependencies = [
209
210
  "tree-sitter-rust",
210
211
  "tree-sitter-scala",
211
212
  "tree-sitter-swift",
212
- "tree-sitter-typescript 0.23.2",
213
+ "tree-sitter-typescript",
213
214
  "tree-sitter-yaml",
214
215
  ]
215
216
 
216
217
  [[package]]
217
218
  name = "ast-grep-lsp"
218
- version = "0.36.0"
219
+ version = "0.36.2"
219
220
  dependencies = [
220
221
  "ast-grep-config",
221
222
  "ast-grep-core",
@@ -229,7 +230,7 @@ dependencies = [
229
230
 
230
231
  [[package]]
231
232
  name = "ast-grep-napi"
232
- version = "0.36.0"
233
+ version = "0.36.2"
233
234
  dependencies = [
234
235
  "ast-grep-config",
235
236
  "ast-grep-core",
@@ -245,7 +246,7 @@ dependencies = [
245
246
 
246
247
  [[package]]
247
248
  name = "ast-grep-py"
248
- version = "0.36.0"
249
+ version = "0.36.2"
249
250
  dependencies = [
250
251
  "anyhow",
251
252
  "ast-grep-config",
@@ -313,7 +314,7 @@ dependencies = [
313
314
 
314
315
  [[package]]
315
316
  name = "benches"
316
- version = "0.36.0"
317
+ version = "0.36.2"
317
318
  dependencies = [
318
319
  "ast-grep-config",
319
320
  "ast-grep-core",
@@ -427,9 +428,9 @@ dependencies = [
427
428
 
428
429
  [[package]]
429
430
  name = "clap"
430
- version = "4.5.31"
431
+ version = "4.5.32"
431
432
  source = "registry+https://github.com/rust-lang/crates.io-index"
432
- checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767"
433
+ checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
433
434
  dependencies = [
434
435
  "clap_builder",
435
436
  "clap_derive",
@@ -437,9 +438,9 @@ dependencies = [
437
438
 
438
439
  [[package]]
439
440
  name = "clap_builder"
440
- version = "4.5.31"
441
+ version = "4.5.32"
441
442
  source = "registry+https://github.com/rust-lang/crates.io-index"
442
- checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863"
443
+ checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
443
444
  dependencies = [
444
445
  "anstream",
445
446
  "anstyle",
@@ -458,9 +459,9 @@ dependencies = [
458
459
 
459
460
  [[package]]
460
461
  name = "clap_derive"
461
- version = "4.5.28"
462
+ version = "4.5.32"
462
463
  source = "registry+https://github.com/rust-lang/crates.io-index"
463
- checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed"
464
+ checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
464
465
  dependencies = [
465
466
  "heck",
466
467
  "proc-macro2",
@@ -681,7 +682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
681
682
  checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
682
683
  dependencies = [
683
684
  "libc",
684
- "windows-sys 0.59.0",
685
+ "windows-sys 0.52.0",
685
686
  ]
686
687
 
687
688
  [[package]]
@@ -823,9 +824,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
823
824
 
824
825
  [[package]]
825
826
  name = "globset"
826
- version = "0.4.15"
827
+ version = "0.4.16"
827
828
  source = "registry+https://github.com/rust-lang/crates.io-index"
828
- checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19"
829
+ checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5"
829
830
  dependencies = [
830
831
  "aho-corasick",
831
832
  "bstr",
@@ -1324,9 +1325,9 @@ dependencies = [
1324
1325
 
1325
1326
  [[package]]
1326
1327
  name = "pyo3"
1327
- version = "0.23.4"
1328
+ version = "0.23.5"
1328
1329
  source = "registry+https://github.com/rust-lang/crates.io-index"
1329
- checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc"
1330
+ checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
1330
1331
  dependencies = [
1331
1332
  "anyhow",
1332
1333
  "cfg-if",
@@ -1343,9 +1344,9 @@ dependencies = [
1343
1344
 
1344
1345
  [[package]]
1345
1346
  name = "pyo3-build-config"
1346
- version = "0.23.4"
1347
+ version = "0.23.5"
1347
1348
  source = "registry+https://github.com/rust-lang/crates.io-index"
1348
- checksum = "1cd3927b5a78757a0d71aa9dff669f903b1eb64b54142a9bd9f757f8fde65fd7"
1349
+ checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
1349
1350
  dependencies = [
1350
1351
  "once_cell",
1351
1352
  "target-lexicon",
@@ -1353,9 +1354,9 @@ dependencies = [
1353
1354
 
1354
1355
  [[package]]
1355
1356
  name = "pyo3-ffi"
1356
- version = "0.23.4"
1357
+ version = "0.23.5"
1357
1358
  source = "registry+https://github.com/rust-lang/crates.io-index"
1358
- checksum = "dab6bb2102bd8f991e7749f130a70d05dd557613e39ed2deeee8e9ca0c4d548d"
1359
+ checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
1359
1360
  dependencies = [
1360
1361
  "libc",
1361
1362
  "pyo3-build-config",
@@ -1363,9 +1364,9 @@ dependencies = [
1363
1364
 
1364
1365
  [[package]]
1365
1366
  name = "pyo3-macros"
1366
- version = "0.23.4"
1367
+ version = "0.23.5"
1367
1368
  source = "registry+https://github.com/rust-lang/crates.io-index"
1368
- checksum = "91871864b353fd5ffcb3f91f2f703a22a9797c91b9ab497b1acac7b07ae509c7"
1369
+ checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
1369
1370
  dependencies = [
1370
1371
  "proc-macro2",
1371
1372
  "pyo3-macros-backend",
@@ -1375,9 +1376,9 @@ dependencies = [
1375
1376
 
1376
1377
  [[package]]
1377
1378
  name = "pyo3-macros-backend"
1378
- version = "0.23.4"
1379
+ version = "0.23.5"
1379
1380
  source = "registry+https://github.com/rust-lang/crates.io-index"
1380
- checksum = "43abc3b80bc20f3facd86cd3c60beed58c3e2aa26213f3cda368de39c60a27e4"
1381
+ checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
1381
1382
  dependencies = [
1382
1383
  "heck",
1383
1384
  "proc-macro2",
@@ -1492,7 +1493,7 @@ dependencies = [
1492
1493
  "errno",
1493
1494
  "libc",
1494
1495
  "linux-raw-sys 0.9.2",
1495
- "windows-sys 0.59.0",
1496
+ "windows-sys 0.52.0",
1496
1497
  ]
1497
1498
 
1498
1499
  [[package]]
@@ -1512,9 +1513,9 @@ dependencies = [
1512
1513
 
1513
1514
  [[package]]
1514
1515
  name = "schemars"
1515
- version = "0.8.21"
1516
+ version = "0.8.22"
1516
1517
  source = "registry+https://github.com/rust-lang/crates.io-index"
1517
- checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92"
1518
+ checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
1518
1519
  dependencies = [
1519
1520
  "dyn-clone",
1520
1521
  "schemars_derive",
@@ -1524,9 +1525,9 @@ dependencies = [
1524
1525
 
1525
1526
  [[package]]
1526
1527
  name = "schemars_derive"
1527
- version = "0.8.21"
1528
+ version = "0.8.22"
1528
1529
  source = "registry+https://github.com/rust-lang/crates.io-index"
1529
- checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e"
1530
+ checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
1530
1531
  dependencies = [
1531
1532
  "proc-macro2",
1532
1533
  "quote",
@@ -1548,18 +1549,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
1548
1549
 
1549
1550
  [[package]]
1550
1551
  name = "serde"
1551
- version = "1.0.218"
1552
+ version = "1.0.219"
1552
1553
  source = "registry+https://github.com/rust-lang/crates.io-index"
1553
- checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60"
1554
+ checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
1554
1555
  dependencies = [
1555
1556
  "serde_derive",
1556
1557
  ]
1557
1558
 
1558
1559
  [[package]]
1559
1560
  name = "serde_derive"
1560
- version = "1.0.218"
1561
+ version = "1.0.219"
1561
1562
  source = "registry+https://github.com/rust-lang/crates.io-index"
1562
- checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b"
1563
+ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
1563
1564
  dependencies = [
1564
1565
  "proc-macro2",
1565
1566
  "quote",
@@ -1668,9 +1669,9 @@ dependencies = [
1668
1669
 
1669
1670
  [[package]]
1670
1671
  name = "smallvec"
1671
- version = "1.13.2"
1672
+ version = "1.14.0"
1672
1673
  source = "registry+https://github.com/rust-lang/crates.io-index"
1673
- checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
1674
+ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
1674
1675
 
1675
1676
  [[package]]
1676
1677
  name = "streaming-iterator"
@@ -1703,16 +1704,15 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
1703
1704
 
1704
1705
  [[package]]
1705
1706
  name = "tempfile"
1706
- version = "3.18.0"
1707
+ version = "3.19.0"
1707
1708
  source = "registry+https://github.com/rust-lang/crates.io-index"
1708
- checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567"
1709
+ checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600"
1709
1710
  dependencies = [
1710
- "cfg-if",
1711
1711
  "fastrand",
1712
1712
  "getrandom",
1713
1713
  "once_cell",
1714
1714
  "rustix 1.0.0",
1715
- "windows-sys 0.59.0",
1715
+ "windows-sys 0.52.0",
1716
1716
  ]
1717
1717
 
1718
1718
  [[package]]
@@ -1732,18 +1732,18 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
1732
1732
 
1733
1733
  [[package]]
1734
1734
  name = "thiserror"
1735
- version = "2.0.11"
1735
+ version = "2.0.12"
1736
1736
  source = "registry+https://github.com/rust-lang/crates.io-index"
1737
- checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc"
1737
+ checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
1738
1738
  dependencies = [
1739
1739
  "thiserror-impl",
1740
1740
  ]
1741
1741
 
1742
1742
  [[package]]
1743
1743
  name = "thiserror-impl"
1744
- version = "2.0.11"
1744
+ version = "2.0.12"
1745
1745
  source = "registry+https://github.com/rust-lang/crates.io-index"
1746
- checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2"
1746
+ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
1747
1747
  dependencies = [
1748
1748
  "proc-macro2",
1749
1749
  "quote",
@@ -1787,9 +1787,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1787
1787
 
1788
1788
  [[package]]
1789
1789
  name = "tokio"
1790
- version = "1.43.0"
1790
+ version = "1.44.1"
1791
1791
  source = "registry+https://github.com/rust-lang/crates.io-index"
1792
- checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
1792
+ checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
1793
1793
  dependencies = [
1794
1794
  "backtrace",
1795
1795
  "bytes",
@@ -2150,16 +2150,6 @@ dependencies = [
2150
2150
  "tree-sitter-language",
2151
2151
  ]
2152
2152
 
2153
- [[package]]
2154
- name = "tree-sitter-typescript"
2155
- version = "0.21.2"
2156
- source = "registry+https://github.com/rust-lang/crates.io-index"
2157
- checksum = "ecb35d98a688378e56c18c9c159824fd16f730ccbea19aacf4f206e5d5438ed9"
2158
- dependencies = [
2159
- "cc",
2160
- "tree-sitter",
2161
- ]
2162
-
2163
2153
  [[package]]
2164
2154
  name = "tree-sitter-typescript"
2165
2155
  version = "0.23.2"
@@ -2413,15 +2403,6 @@ dependencies = [
2413
2403
  "windows-targets 0.52.6",
2414
2404
  ]
2415
2405
 
2416
- [[package]]
2417
- name = "windows-sys"
2418
- version = "0.59.0"
2419
- source = "registry+https://github.com/rust-lang/crates.io-index"
2420
- checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
2421
- dependencies = [
2422
- "windows-targets 0.52.6",
2423
- ]
2424
-
2425
2406
  [[package]]
2426
2407
  name = "windows-targets"
2427
2408
  version = "0.48.5"
@@ -7,7 +7,7 @@ resolver = "2"
7
7
  lto = true
8
8
 
9
9
  [workspace.package]
10
- version = "0.36.0"
10
+ version = "0.36.2"
11
11
  authors = ["Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>"]
12
12
  edition = "2021"
13
13
  license = "MIT"
@@ -18,11 +18,11 @@ rust-version = "1.70"
18
18
  readme = "README.md"
19
19
 
20
20
  [workspace.dependencies]
21
- ast-grep-core = { path = "crates/core", version = "0.36.0" }
22
- ast-grep-config = { path = "crates/config", version = "0.36.0" }
23
- ast-grep-dynamic = { path = "crates/dynamic", version = "0.36.0" }
24
- ast-grep-language = { path = "crates/language", version = "0.36.0" }
25
- ast-grep-lsp = { path = "crates/lsp", version = "0.36.0" }
21
+ ast-grep-core = { path = "crates/core", version = "0.36.2" }
22
+ ast-grep-config = { path = "crates/config", version = "0.36.2" }
23
+ ast-grep-dynamic = { path = "crates/dynamic", version = "0.36.2" }
24
+ ast-grep-language = { path = "crates/language", version = "0.36.2" }
25
+ ast-grep-lsp = { path = "crates/lsp", version = "0.36.2" }
26
26
 
27
27
  bit-set = { version = "0.8.0" }
28
28
  ignore = { version = "0.4.22" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ast-grep-cli
3
- Version: 0.36.0
3
+ Version: 0.36.2
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -46,6 +46,7 @@ serde.workspace = true
46
46
  serde_json = "1.0.116"
47
47
  serde_yaml.workspace = true
48
48
  similar = { version = "2.5.0", features = ["inline"] }
49
+ smallvec = "1.13.2"
49
50
  tokio = { version = "1.37.0", features = ["rt-multi-thread", "io-std"] }
50
51
  clap_complete = "4.5.2"
51
52
 
@@ -239,17 +239,13 @@ fn test_non_overlap_print() {
239
239
  test_non_overlap_print_impl(Heading::Auto);
240
240
  }
241
241
 
242
- #[test]
243
- fn test_print_rule_diffs() {
242
+ fn get_printed_text(mut printer: ColoredPrinter<Buffer>, diff_case: &DiffCase) -> String {
243
+ let (source, pattern, rewrite, _) = diff_case;
244
244
  let globals = GlobalRules::default();
245
- for &(source, pattern, rewrite, note) in DIFF_CASES {
246
- let mut printer = make_test_printer()
247
- .heading(Heading::Never)
248
- .style(ReportStyle::Short);
249
- let grep = SgLang::from(SupportLang::TypeScript).ast_grep(source);
250
- let rule = from_yaml_string(
251
- &format!(
252
- r"
245
+ let grep = SgLang::from(SupportLang::TypeScript).ast_grep(source);
246
+ let rule = from_yaml_string(
247
+ &format!(
248
+ r"
253
249
  id: test-id
254
250
  message: test rule
255
251
  severity: info
@@ -257,28 +253,52 @@ language: TypeScript
257
253
  rule:
258
254
  pattern: {pattern}
259
255
  fix: '{rewrite}'"
260
- ),
261
- &globals,
262
- )
263
- .expect("should parse")
264
- .pop()
265
- .unwrap();
266
- let matcher = rule.get_matcher(&globals).expect("should parse");
267
- let fixer = matcher.fixer.as_ref().expect("should have fixer");
268
- let matches = grep.root().find_all(&matcher);
269
- let diffs = matches.map(|n| (Diff::generate(n, &pattern, fixer), &rule));
270
- let buffer = printer
271
- .get_processor()
272
- .print_rule_diffs(diffs.collect(), Path::new("test.tsx"))
273
- .expect("test only");
274
- printer.process(buffer).expect("test only");
275
- let text = get_text(&printer);
256
+ ),
257
+ &globals,
258
+ )
259
+ .expect("should parse")
260
+ .pop()
261
+ .unwrap();
262
+ let matcher = rule.get_matcher(&globals).expect("should parse");
263
+ let fixer = matcher.fixer.as_ref().expect("should have fixer");
264
+ let matches = grep.root().find_all(&matcher);
265
+ let diffs = matches.map(|n| (Diff::generate(n, &pattern, fixer), &rule));
266
+ let buffer = printer
267
+ .get_processor()
268
+ .print_rule_diffs(diffs.collect(), Path::new("test.tsx"))
269
+ .expect("test only");
270
+ printer.process(buffer).expect("test only");
271
+ get_text(&printer)
272
+ }
273
+
274
+ #[test]
275
+ fn test_print_rule_diffs() {
276
+ for diff_case in DIFF_CASES {
277
+ let printer = make_test_printer()
278
+ .heading(Heading::Never)
279
+ .style(ReportStyle::Rich);
280
+ let text = get_printed_text(printer, diff_case);
281
+ let (_, _, rewrite, note) = diff_case;
276
282
  assert!(text.contains("test.tsx"), "{note}");
277
283
  assert!(text.contains("note[test-id]"), "{note}");
278
284
  assert!(text.contains(rewrite), "{note}");
279
285
  }
280
286
  }
281
287
 
288
+ #[test]
289
+ fn test_print_rule_diffs_short() {
290
+ for diff_case in DIFF_CASES {
291
+ let printer = make_test_printer()
292
+ .heading(Heading::Never)
293
+ .style(ReportStyle::Short);
294
+ let text = get_printed_text(printer, diff_case);
295
+ let (_, _, rewrite, note) = diff_case;
296
+ assert!(text.contains("test.tsx:"), "{note}");
297
+ assert!(text.contains("note[test-id]"), "{note}");
298
+ assert!(rewrite.is_empty() || !text.contains(rewrite), "{note}");
299
+ }
300
+ }
301
+
282
302
  #[test]
283
303
  fn test_before_after() {
284
304
  let src = "
@@ -217,7 +217,7 @@ impl PrintProcessor<Buffer> for ColoredProcessor {
217
217
  let mut buffer = create_buffer(self.color);
218
218
  let writer = &mut buffer;
219
219
  let mut start = 0;
220
- self.styles.print_prelude(path, writer)?;
220
+ let display_style = &self.config.display_style;
221
221
  for (diff, rule) in diffs {
222
222
  let range = &diff.range;
223
223
  // skip overlapping diff
@@ -225,21 +225,37 @@ impl PrintProcessor<Buffer> for ColoredProcessor {
225
225
  continue;
226
226
  }
227
227
  start = range.end;
228
+ if matches!(display_style, DisplayStyle::Rich) {
229
+ self.styles.print_prelude(path, writer)?;
230
+ } else {
231
+ let pos = diff.node_match.start_pos();
232
+ write!(
233
+ writer,
234
+ "{}:{}:{}: ",
235
+ path.display(),
236
+ pos.line() + 1,
237
+ pos.column(&diff.node_match) + 1
238
+ )?;
239
+ }
228
240
  print_rule_title(rule, &diff.node_match, &self.styles.rule, writer)?;
229
- let source = diff.get_root_text();
230
- let new_str = format!(
231
- "{}{}{}",
232
- &source[..range.start],
233
- diff.replacement,
234
- &source[start..],
235
- );
236
- self
237
- .styles
238
- .diff
239
- .print_diff(source, &new_str, writer, context)?;
240
- if let Some(note) = &rule.note {
241
- writeln!(writer, "{}", self.styles.rule.note.paint("Note:"))?;
242
- writeln!(writer, "{note}")?;
241
+ if matches!(display_style, DisplayStyle::Rich) {
242
+ let source = diff.get_root_text();
243
+ let new_str = format!(
244
+ "{}{}{}",
245
+ &source[..range.start],
246
+ diff.replacement,
247
+ &source[start..],
248
+ );
249
+ self
250
+ .styles
251
+ .diff
252
+ .print_diff(source, &new_str, writer, context)?;
253
+ }
254
+ if matches!(display_style, DisplayStyle::Medium | DisplayStyle::Rich) {
255
+ if let Some(note) = &rule.note {
256
+ writeln!(writer, "{}", self.styles.rule.note.paint("Note:"))?;
257
+ writeln!(writer, "{note}")?;
258
+ }
243
259
  }
244
260
  }
245
261
  Ok(buffer)