ast-grep-cli 0.40.3__tar.gz → 0.40.4__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 (125) hide show
  1. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/Cargo.lock +67 -61
  2. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/Cargo.toml +6 -6
  3. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/PKG-INFO +1 -1
  4. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/lib.rs +5 -0
  5. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/colored_print.rs +2 -2
  6. ast_grep_cli-0.40.4/crates/cli/src/print/file_name_printer.rs +105 -0
  7. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/mod.rs +3 -0
  8. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/run.rs +7 -1
  9. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/scan.rs +7 -2
  10. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/args.rs +9 -0
  11. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/tests/help_test.rs +2 -2
  12. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/tests/run_test.rs +13 -13
  13. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/tests/scan_test.rs +24 -24
  14. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/Cargo.toml +1 -1
  15. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/pyproject.toml +1 -1
  16. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/LICENSE +0 -0
  17. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/README.md +0 -0
  18. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/Cargo.toml +0 -0
  19. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/README.md +0 -0
  20. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/bin/alias.rs +0 -0
  21. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/completions.rs +0 -0
  22. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/config.rs +0 -0
  23. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/lang/injection.rs +0 -0
  24. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/lang/lang_globs.rs +0 -0
  25. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/lang/mod.rs +0 -0
  26. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/lsp.rs +0 -0
  27. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/main.rs +0 -0
  28. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/new.rs +0 -0
  29. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/cloud_print.rs +0 -0
  30. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/colored_print/markdown.rs +0 -0
  31. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/colored_print/match_merger.rs +0 -0
  32. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/colored_print/styles.rs +0 -0
  33. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/colored_print/test.rs +0 -0
  34. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/interactive_print.rs +0 -0
  35. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/print/json_print.rs +0 -0
  36. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/debug_query.rs +0 -0
  37. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/error_context.rs +0 -0
  38. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/inspect.rs +0 -0
  39. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/mod.rs +0 -0
  40. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/print_diff.rs +0 -0
  41. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/rule_overwrite.rs +0 -0
  42. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/utils/worker.rs +0 -0
  43. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/verify/case_result.rs +0 -0
  44. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/verify/find_file.rs +0 -0
  45. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/verify/reporter.rs +0 -0
  46. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/verify/snapshot.rs +0 -0
  47. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/verify/test_case.rs +0 -0
  48. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/src/verify.rs +0 -0
  49. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/tests/common/mod.rs +0 -0
  50. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/cli/tests/verify_test.rs +0 -0
  51. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/Cargo.toml +0 -0
  52. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/check_var.rs +0 -0
  53. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/combined.rs +0 -0
  54. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/fixer.rs +0 -0
  55. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/label.rs +0 -0
  56. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/lib.rs +0 -0
  57. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/maybe.rs +0 -0
  58. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/deserialize_env.rs +0 -0
  59. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/mod.rs +0 -0
  60. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/nth_child.rs +0 -0
  61. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/range.rs +0 -0
  62. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/referent_rule.rs +0 -0
  63. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/relational_rule.rs +0 -0
  64. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/selector.rs +0 -0
  65. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule/stop_by.rs +0 -0
  66. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule_collection.rs +0 -0
  67. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule_config.rs +0 -0
  68. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/rule_core.rs +0 -0
  69. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/transform/mod.rs +0 -0
  70. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/transform/parse.rs +0 -0
  71. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/transform/rewrite.rs +0 -0
  72. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/transform/string_case.rs +0 -0
  73. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/config/src/transform/trans.rs +0 -0
  74. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/Cargo.toml +0 -0
  75. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/language.rs +0 -0
  76. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/lib.rs +0 -0
  77. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/match_tree/match_node.rs +0 -0
  78. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/match_tree/mod.rs +0 -0
  79. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/match_tree/strictness.rs +0 -0
  80. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/matcher/kind.rs +0 -0
  81. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/matcher/node_match.rs +0 -0
  82. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/matcher/pattern.rs +0 -0
  83. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/matcher/text.rs +0 -0
  84. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/matcher.rs +0 -0
  85. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/meta_var.rs +0 -0
  86. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/node.rs +0 -0
  87. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/ops.rs +0 -0
  88. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/pinned.rs +0 -0
  89. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/replacer/indent.rs +0 -0
  90. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/replacer/structural.rs +0 -0
  91. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/replacer/template.rs +0 -0
  92. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/replacer.rs +0 -0
  93. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/source.rs +0 -0
  94. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/tree_sitter/mod.rs +0 -0
  95. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/core/src/tree_sitter/traversal.rs +0 -0
  96. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/dynamic/Cargo.toml +0 -0
  97. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/dynamic/src/custom_lang.rs +0 -0
  98. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/dynamic/src/lib.rs +0 -0
  99. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/bash.rs +0 -0
  100. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/cpp.rs +0 -0
  101. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/csharp.rs +0 -0
  102. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/css.rs +0 -0
  103. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/elixir.rs +0 -0
  104. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/go.rs +0 -0
  105. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/haskell.rs +0 -0
  106. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/hcl.rs +0 -0
  107. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/html.rs +0 -0
  108. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/json.rs +0 -0
  109. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/kotlin.rs +0 -0
  110. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/lib.rs +0 -0
  111. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/lua.rs +0 -0
  112. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/nix.rs +0 -0
  113. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/parsers.rs +0 -0
  114. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/php.rs +0 -0
  115. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/python.rs +0 -0
  116. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/ruby.rs +0 -0
  117. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/rust.rs +0 -0
  118. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/scala.rs +0 -0
  119. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/solidity.rs +0 -0
  120. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/swift.rs +0 -0
  121. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/language/src/yaml.rs +0 -0
  122. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/lsp/Cargo.toml +0 -0
  123. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/lsp/src/lib.rs +0 -0
  124. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/lsp/src/utils.rs +0 -0
  125. {ast_grep_cli-0.40.3 → ast_grep_cli-0.40.4}/crates/lsp/tests/basic.rs +0 -0
@@ -103,7 +103,7 @@ dependencies = [
103
103
 
104
104
  [[package]]
105
105
  name = "ast-grep"
106
- version = "0.40.3"
106
+ version = "0.40.4"
107
107
  dependencies = [
108
108
  "ansi_term",
109
109
  "anyhow",
@@ -138,7 +138,7 @@ dependencies = [
138
138
 
139
139
  [[package]]
140
140
  name = "ast-grep-config"
141
- version = "0.40.3"
141
+ version = "0.40.4"
142
142
  dependencies = [
143
143
  "ast-grep-core",
144
144
  "bit-set",
@@ -153,7 +153,7 @@ dependencies = [
153
153
 
154
154
  [[package]]
155
155
  name = "ast-grep-core"
156
- version = "0.40.3"
156
+ version = "0.40.4"
157
157
  dependencies = [
158
158
  "bit-set",
159
159
  "regex",
@@ -164,7 +164,7 @@ dependencies = [
164
164
 
165
165
  [[package]]
166
166
  name = "ast-grep-dynamic"
167
- version = "0.40.3"
167
+ version = "0.40.4"
168
168
  dependencies = [
169
169
  "ast-grep-core",
170
170
  "ignore",
@@ -178,7 +178,7 @@ dependencies = [
178
178
 
179
179
  [[package]]
180
180
  name = "ast-grep-language"
181
- version = "0.40.3"
181
+ version = "0.40.4"
182
182
  dependencies = [
183
183
  "ast-grep-core",
184
184
  "ignore",
@@ -213,7 +213,7 @@ dependencies = [
213
213
 
214
214
  [[package]]
215
215
  name = "ast-grep-lsp"
216
- version = "0.40.3"
216
+ version = "0.40.4"
217
217
  dependencies = [
218
218
  "anyhow",
219
219
  "ast-grep-config",
@@ -231,7 +231,7 @@ dependencies = [
231
231
 
232
232
  [[package]]
233
233
  name = "ast-grep-napi"
234
- version = "0.40.3"
234
+ version = "0.40.4"
235
235
  dependencies = [
236
236
  "ast-grep-config",
237
237
  "ast-grep-core",
@@ -247,7 +247,7 @@ dependencies = [
247
247
 
248
248
  [[package]]
249
249
  name = "ast-grep-py"
250
- version = "0.40.3"
250
+ version = "0.40.4"
251
251
  dependencies = [
252
252
  "anyhow",
253
253
  "ast-grep-config",
@@ -344,9 +344,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
344
344
 
345
345
  [[package]]
346
346
  name = "clap"
347
- version = "4.5.53"
347
+ version = "4.5.54"
348
348
  source = "registry+https://github.com/rust-lang/crates.io-index"
349
- checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
349
+ checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394"
350
350
  dependencies = [
351
351
  "clap_builder",
352
352
  "clap_derive",
@@ -354,9 +354,9 @@ dependencies = [
354
354
 
355
355
  [[package]]
356
356
  name = "clap_builder"
357
- version = "4.5.53"
357
+ version = "4.5.54"
358
358
  source = "registry+https://github.com/rust-lang/crates.io-index"
359
- checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
359
+ checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00"
360
360
  dependencies = [
361
361
  "anstream",
362
362
  "anstyle",
@@ -366,9 +366,9 @@ dependencies = [
366
366
 
367
367
  [[package]]
368
368
  name = "clap_complete"
369
- version = "4.5.61"
369
+ version = "4.5.64"
370
370
  source = "registry+https://github.com/rust-lang/crates.io-index"
371
- checksum = "39615915e2ece2550c0149addac32fb5bd312c657f43845bb9088cb9c8a7c992"
371
+ checksum = "4c0da80818b2d95eca9aa614a30783e42f62bf5fdfee24e68cfb960b071ba8d1"
372
372
  dependencies = [
373
373
  "clap",
374
374
  ]
@@ -929,9 +929,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
929
929
 
930
930
  [[package]]
931
931
  name = "libc"
932
- version = "0.2.172"
932
+ version = "0.2.178"
933
933
  source = "registry+https://github.com/rust-lang/crates.io-index"
934
- checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
934
+ checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
935
935
 
936
936
  [[package]]
937
937
  name = "libloading"
@@ -945,9 +945,9 @@ dependencies = [
945
945
 
946
946
  [[package]]
947
947
  name = "linux-raw-sys"
948
- version = "0.9.4"
948
+ version = "0.11.0"
949
949
  source = "registry+https://github.com/rust-lang/crates.io-index"
950
- checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
950
+ checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
951
951
 
952
952
  [[package]]
953
953
  name = "litrs"
@@ -1022,9 +1022,9 @@ dependencies = [
1022
1022
 
1023
1023
  [[package]]
1024
1024
  name = "napi"
1025
- version = "3.7.0"
1025
+ version = "3.8.1"
1026
1026
  source = "registry+https://github.com/rust-lang/crates.io-index"
1027
- checksum = "f27a163b545fd2184d2efdccf3d3df56acdb63465f2fcfebcaee0463c1e91783"
1027
+ checksum = "000f205daae6646003fdc38517be6232af2b150bad4b67bdaf4c5aadb119d738"
1028
1028
  dependencies = [
1029
1029
  "anyhow",
1030
1030
  "bitflags",
@@ -1046,9 +1046,9 @@ checksum = "d376940fd5b723c6893cd1ee3f33abbfd86acb1cd1ec079f3ab04a2a3bc4d3b1"
1046
1046
 
1047
1047
  [[package]]
1048
1048
  name = "napi-derive"
1049
- version = "3.4.0"
1049
+ version = "3.5.0"
1050
1050
  source = "registry+https://github.com/rust-lang/crates.io-index"
1051
- checksum = "47cffa09ea668c4cc5d7b1198780882e28780ed1804a903b80680725426223d9"
1051
+ checksum = "97ef4e39564b008771df9a4983e4ea6c1f7fa6ad5252347b6dbf7f347a8f689a"
1052
1052
  dependencies = [
1053
1053
  "convert_case 0.10.0",
1054
1054
  "ctor",
@@ -1060,9 +1060,9 @@ dependencies = [
1060
1060
 
1061
1061
  [[package]]
1062
1062
  name = "napi-derive-backend"
1063
- version = "4.0.0"
1063
+ version = "5.0.0"
1064
1064
  source = "registry+https://github.com/rust-lang/crates.io-index"
1065
- checksum = "5e186227ec22f4675267a176d98dffecb27e6cc88926cbb7efb5427268565c0f"
1065
+ checksum = "eb0d9a16e3fbfd6397f97e4eaafe9fbefb888a6120dd289dd12869fdb16af372"
1066
1066
  dependencies = [
1067
1067
  "convert_case 0.10.0",
1068
1068
  "proc-macro2",
@@ -1217,9 +1217,9 @@ dependencies = [
1217
1217
 
1218
1218
  [[package]]
1219
1219
  name = "pyo3"
1220
- version = "0.27.1"
1220
+ version = "0.27.2"
1221
1221
  source = "registry+https://github.com/rust-lang/crates.io-index"
1222
- checksum = "37a6df7eab65fc7bee654a421404947e10a0f7085b6951bf2ea395f4659fb0cf"
1222
+ checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d"
1223
1223
  dependencies = [
1224
1224
  "anyhow",
1225
1225
  "indoc",
@@ -1235,18 +1235,18 @@ dependencies = [
1235
1235
 
1236
1236
  [[package]]
1237
1237
  name = "pyo3-build-config"
1238
- version = "0.27.1"
1238
+ version = "0.27.2"
1239
1239
  source = "registry+https://github.com/rust-lang/crates.io-index"
1240
- checksum = "f77d387774f6f6eec64a004eac0ed525aab7fa1966d94b42f743797b3e395afb"
1240
+ checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6"
1241
1241
  dependencies = [
1242
1242
  "target-lexicon",
1243
1243
  ]
1244
1244
 
1245
1245
  [[package]]
1246
1246
  name = "pyo3-ffi"
1247
- version = "0.27.1"
1247
+ version = "0.27.2"
1248
1248
  source = "registry+https://github.com/rust-lang/crates.io-index"
1249
- checksum = "2dd13844a4242793e02df3e2ec093f540d948299a6a77ea9ce7afd8623f542be"
1249
+ checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089"
1250
1250
  dependencies = [
1251
1251
  "libc",
1252
1252
  "pyo3-build-config",
@@ -1254,9 +1254,9 @@ dependencies = [
1254
1254
 
1255
1255
  [[package]]
1256
1256
  name = "pyo3-macros"
1257
- version = "0.27.1"
1257
+ version = "0.27.2"
1258
1258
  source = "registry+https://github.com/rust-lang/crates.io-index"
1259
- checksum = "eaf8f9f1108270b90d3676b8679586385430e5c0bb78bb5f043f95499c821a71"
1259
+ checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02"
1260
1260
  dependencies = [
1261
1261
  "proc-macro2",
1262
1262
  "pyo3-macros-backend",
@@ -1266,9 +1266,9 @@ dependencies = [
1266
1266
 
1267
1267
  [[package]]
1268
1268
  name = "pyo3-macros-backend"
1269
- version = "0.27.1"
1269
+ version = "0.27.2"
1270
1270
  source = "registry+https://github.com/rust-lang/crates.io-index"
1271
- checksum = "70a3b2274450ba5288bc9b8c1b69ff569d1d61189d4bff38f8d22e03d17f932b"
1271
+ checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9"
1272
1272
  dependencies = [
1273
1273
  "heck",
1274
1274
  "proc-macro2",
@@ -1368,9 +1368,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
1368
1368
 
1369
1369
  [[package]]
1370
1370
  name = "rustix"
1371
- version = "1.0.5"
1371
+ version = "1.1.3"
1372
1372
  source = "registry+https://github.com/rust-lang/crates.io-index"
1373
- checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf"
1373
+ checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
1374
1374
  dependencies = [
1375
1375
  "bitflags",
1376
1376
  "errno",
@@ -1423,9 +1423,9 @@ dependencies = [
1423
1423
 
1424
1424
  [[package]]
1425
1425
  name = "schemars"
1426
- version = "1.1.0"
1426
+ version = "1.2.0"
1427
1427
  source = "registry+https://github.com/rust-lang/crates.io-index"
1428
- checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289"
1428
+ checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2"
1429
1429
  dependencies = [
1430
1430
  "dyn-clone",
1431
1431
  "ref-cast",
@@ -1436,9 +1436,9 @@ dependencies = [
1436
1436
 
1437
1437
  [[package]]
1438
1438
  name = "schemars_derive"
1439
- version = "1.1.0"
1439
+ version = "1.2.0"
1440
1440
  source = "registry+https://github.com/rust-lang/crates.io-index"
1441
- checksum = "301858a4023d78debd2353c7426dc486001bddc91ae31a76fb1f55132f7e2633"
1441
+ checksum = "4908ad288c5035a8eb12cfdf0d49270def0a268ee162b75eeee0f85d155a7c45"
1442
1442
  dependencies = [
1443
1443
  "proc-macro2",
1444
1444
  "quote",
@@ -1521,16 +1521,16 @@ dependencies = [
1521
1521
 
1522
1522
  [[package]]
1523
1523
  name = "serde_json"
1524
- version = "1.0.145"
1524
+ version = "1.0.148"
1525
1525
  source = "registry+https://github.com/rust-lang/crates.io-index"
1526
- checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
1526
+ checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da"
1527
1527
  dependencies = [
1528
1528
  "indexmap",
1529
1529
  "itoa",
1530
1530
  "memchr",
1531
- "ryu",
1532
1531
  "serde",
1533
1532
  "serde_core",
1533
+ "zmij",
1534
1534
  ]
1535
1535
 
1536
1536
  [[package]]
@@ -1681,9 +1681,9 @@ checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b"
1681
1681
 
1682
1682
  [[package]]
1683
1683
  name = "tempfile"
1684
- version = "3.23.0"
1684
+ version = "3.24.0"
1685
1685
  source = "registry+https://github.com/rust-lang/crates.io-index"
1686
- checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
1686
+ checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
1687
1687
  dependencies = [
1688
1688
  "fastrand",
1689
1689
  "getrandom",
@@ -1787,9 +1787,9 @@ dependencies = [
1787
1787
 
1788
1788
  [[package]]
1789
1789
  name = "tokio"
1790
- version = "1.48.0"
1790
+ version = "1.49.0"
1791
1791
  source = "registry+https://github.com/rust-lang/crates.io-index"
1792
- checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
1792
+ checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
1793
1793
  dependencies = [
1794
1794
  "bytes",
1795
1795
  "pin-project-lite",
@@ -1809,9 +1809,9 @@ dependencies = [
1809
1809
 
1810
1810
  [[package]]
1811
1811
  name = "tokio-stream"
1812
- version = "0.1.17"
1812
+ version = "0.1.18"
1813
1813
  source = "registry+https://github.com/rust-lang/crates.io-index"
1814
- checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047"
1814
+ checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70"
1815
1815
  dependencies = [
1816
1816
  "futures-core",
1817
1817
  "pin-project-lite",
@@ -1820,9 +1820,9 @@ dependencies = [
1820
1820
 
1821
1821
  [[package]]
1822
1822
  name = "tokio-util"
1823
- version = "0.7.17"
1823
+ version = "0.7.18"
1824
1824
  source = "registry+https://github.com/rust-lang/crates.io-index"
1825
- checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594"
1825
+ checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
1826
1826
  dependencies = [
1827
1827
  "bytes",
1828
1828
  "futures-core",
@@ -1833,18 +1833,18 @@ dependencies = [
1833
1833
 
1834
1834
  [[package]]
1835
1835
  name = "toml_datetime"
1836
- version = "0.7.3"
1836
+ version = "0.7.5+spec-1.1.0"
1837
1837
  source = "registry+https://github.com/rust-lang/crates.io-index"
1838
- checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533"
1838
+ checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
1839
1839
  dependencies = [
1840
1840
  "serde_core",
1841
1841
  ]
1842
1842
 
1843
1843
  [[package]]
1844
1844
  name = "toml_edit"
1845
- version = "0.23.9"
1845
+ version = "0.24.0+spec-1.1.0"
1846
1846
  source = "registry+https://github.com/rust-lang/crates.io-index"
1847
- checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832"
1847
+ checksum = "8c740b185920170a6d9191122cafef7010bd6270a3824594bff6784c04d7f09e"
1848
1848
  dependencies = [
1849
1849
  "indexmap",
1850
1850
  "toml_datetime",
@@ -1855,18 +1855,18 @@ dependencies = [
1855
1855
 
1856
1856
  [[package]]
1857
1857
  name = "toml_parser"
1858
- version = "1.0.4"
1858
+ version = "1.0.6+spec-1.1.0"
1859
1859
  source = "registry+https://github.com/rust-lang/crates.io-index"
1860
- checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e"
1860
+ checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
1861
1861
  dependencies = [
1862
1862
  "winnow",
1863
1863
  ]
1864
1864
 
1865
1865
  [[package]]
1866
1866
  name = "toml_writer"
1867
- version = "1.0.4"
1867
+ version = "1.0.6+spec-1.1.0"
1868
1868
  source = "registry+https://github.com/rust-lang/crates.io-index"
1869
- checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
1869
+ checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
1870
1870
 
1871
1871
  [[package]]
1872
1872
  name = "tower"
@@ -2107,9 +2107,9 @@ checksum = "c4013970217383f67b18aef68f6fb2e8d409bc5755227092d32efb0422ba24b8"
2107
2107
 
2108
2108
  [[package]]
2109
2109
  name = "tree-sitter-lua"
2110
- version = "0.2.0"
2110
+ version = "0.4.1"
2111
2111
  source = "registry+https://github.com/rust-lang/crates.io-index"
2112
- checksum = "5cdb9adf0965fec58e7660cbb3a059dbb12ebeec9459e6dcbae3db004739641e"
2112
+ checksum = "ea992f4164d83f371ef1239ae178c4d4596c296c09055e9a48bb02a2760403af"
2113
2113
  dependencies = [
2114
2114
  "cc",
2115
2115
  "tree-sitter-language",
@@ -2480,3 +2480,9 @@ dependencies = [
2480
2480
  "nix",
2481
2481
  "thiserror 1.0.69",
2482
2482
  ]
2483
+
2484
+ [[package]]
2485
+ name = "zmij"
2486
+ version = "1.0.10"
2487
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2488
+ checksum = "30e0d8dffbae3d840f64bda38e28391faef673a7b5a6017840f2a106c8145868"
@@ -7,7 +7,7 @@ resolver = "2"
7
7
  lto = true
8
8
 
9
9
  [workspace.package]
10
- version = "0.40.3"
10
+ version = "0.40.4"
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.79"
18
18
  readme = "README.md"
19
19
 
20
20
  [workspace.dependencies]
21
- ast-grep-core = { path = "crates/core", version = "0.40.3", default-features = false }
22
- ast-grep-config = { path = "crates/config", version = "0.40.3" }
23
- ast-grep-dynamic = { path = "crates/dynamic", version = "0.40.3" }
24
- ast-grep-language = { path = "crates/language", version = "0.40.3" }
25
- ast-grep-lsp = { path = "crates/lsp", version = "0.40.3" }
21
+ ast-grep-core = { path = "crates/core", version = "0.40.4", default-features = false }
22
+ ast-grep-config = { path = "crates/config", version = "0.40.4" }
23
+ ast-grep-dynamic = { path = "crates/dynamic", version = "0.40.4" }
24
+ ast-grep-language = { path = "crates/language", version = "0.40.4" }
25
+ ast-grep-lsp = { path = "crates/lsp", version = "0.40.4" }
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.40.3
3
+ Version: 0.40.4
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -231,6 +231,7 @@ mod test_cli {
231
231
  ok("run -p test --globs '*.js' --globs '*.ts'");
232
232
  ok("run -p fubuki -j8");
233
233
  ok("run -p test --threads 12");
234
+ ok("run -p test --files-with-matches");
234
235
  ok("run -p test -l rs -c config.yml"); // global config arg
235
236
  error("run test");
236
237
  error("run --debug-query test"); // missing lang
@@ -242,6 +243,8 @@ mod test_cli {
242
243
  error("run -p test -l rs --debug-query=not");
243
244
  error("run -p test --selector");
244
245
  error("run -p test --threads");
246
+ error("run -p test --files-with-matches -r test -U");
247
+ error("run -p test --files-with-matches --json");
245
248
  }
246
249
 
247
250
  #[test]
@@ -278,6 +281,8 @@ mod test_cli {
278
281
  error("scan -j");
279
282
  error("scan --include-metadata"); // requires json
280
283
  error("scan --threads");
284
+ error("scan --files-with-matches -U");
285
+ error("scan --files-with-matches --json");
281
286
  }
282
287
 
283
288
  #[test]
@@ -21,8 +21,8 @@ mod test;
21
21
 
22
22
  use markdown::Markdown;
23
23
  use match_merger::MatchMerger;
24
- pub use styles::should_use_color;
25
- use styles::{PrintStyles, RuleStyle};
24
+ use styles::RuleStyle;
25
+ pub use styles::{should_use_color, PrintStyles};
26
26
 
27
27
  #[derive(Clone, Copy, ValueEnum)]
28
28
  pub enum ReportStyle {
@@ -0,0 +1,105 @@
1
+ use super::{Diff, NodeMatch, PrintProcessor, Printer};
2
+ use crate::lang::SgLang;
3
+ use anyhow::Result;
4
+ use ast_grep_config::RuleConfig;
5
+ use codespan_reporting::files::SimpleFile;
6
+ use codespan_reporting::term::termcolor::{Buffer, ColorChoice, StandardStream, WriteColor};
7
+
8
+ use std::borrow::Cow;
9
+ use std::path::Path;
10
+
11
+ use super::PrintStyles;
12
+
13
+ pub struct FileNamePrinter<W: WriteColor> {
14
+ writer: W,
15
+ styles: PrintStyles,
16
+ }
17
+
18
+ impl<W: WriteColor> FileNamePrinter<W> {
19
+ pub fn new(writer: W) -> Self {
20
+ Self {
21
+ writer,
22
+ styles: PrintStyles::from(ColorChoice::Auto),
23
+ }
24
+ }
25
+
26
+ pub fn color<C: Into<ColorChoice>>(mut self, color: C) -> Self {
27
+ let color = color.into();
28
+ self.styles = PrintStyles::from(color);
29
+ self
30
+ }
31
+ }
32
+
33
+ impl<W: WriteColor> Printer for FileNamePrinter<W> {
34
+ type Processed = Buffer;
35
+ type Processor = FileNameProcessor;
36
+
37
+ fn get_processor(&self) -> Self::Processor {
38
+ let color = self.writer.supports_color();
39
+ FileNameProcessor {
40
+ color,
41
+ styles: self.styles.clone(),
42
+ }
43
+ }
44
+
45
+ fn process(&mut self, buffer: Buffer) -> Result<()> {
46
+ self.writer.write_all(buffer.as_slice())?;
47
+ Ok(())
48
+ }
49
+ }
50
+
51
+ impl FileNamePrinter<StandardStream> {
52
+ pub fn stdout<C: Into<ColorChoice>>(color: C) -> Self {
53
+ let color = color.into();
54
+ FileNamePrinter::new(StandardStream::stdout(color)).color(color)
55
+ }
56
+ }
57
+
58
+ fn create_buffer(color: bool) -> Buffer {
59
+ if color {
60
+ Buffer::ansi()
61
+ } else {
62
+ Buffer::no_color()
63
+ }
64
+ }
65
+
66
+ pub struct FileNameProcessor {
67
+ color: bool,
68
+ styles: PrintStyles,
69
+ }
70
+
71
+ impl FileNameProcessor {
72
+ fn print_path(&self, path: &Path) -> Result<Buffer> {
73
+ let styles = &self.styles;
74
+ let mut buffer = create_buffer(self.color);
75
+ styles.print_prelude(path, &mut buffer)?;
76
+ Ok(buffer)
77
+ }
78
+ }
79
+
80
+ impl PrintProcessor<Buffer> for FileNameProcessor {
81
+ fn print_rule(
82
+ &self,
83
+ _matches: Vec<NodeMatch>,
84
+ file: SimpleFile<Cow<str>, &str>,
85
+ _rule: &RuleConfig<SgLang>,
86
+ ) -> Result<Buffer> {
87
+ let path = Path::new(file.name().as_ref());
88
+ self.print_path(path)
89
+ }
90
+
91
+ fn print_matches(&self, _matches: Vec<NodeMatch>, path: &Path) -> Result<Buffer> {
92
+ self.print_path(path)
93
+ }
94
+
95
+ fn print_diffs(&self, _diffs: Vec<Diff>, path: &Path) -> Result<Buffer> {
96
+ self.print_path(path)
97
+ }
98
+ fn print_rule_diffs(
99
+ &self,
100
+ _diffs: Vec<(Diff<'_>, &RuleConfig<SgLang>)>,
101
+ path: &Path,
102
+ ) -> Result<Buffer> {
103
+ self.print_path(path)
104
+ }
105
+ }
@@ -1,5 +1,6 @@
1
1
  mod cloud_print;
2
2
  mod colored_print;
3
+ mod file_name_printer;
3
4
  mod interactive_print;
4
5
  mod json_print;
5
6
 
@@ -16,7 +17,9 @@ use std::path::Path;
16
17
  pub use cloud_print::{CloudPrinter, Platform};
17
18
  pub use codespan_reporting::files::SimpleFile;
18
19
  use codespan_reporting::term::termcolor::ColorChoice;
20
+ use colored_print::PrintStyles;
19
21
  pub use colored_print::{ColoredPrinter, Heading, ReportStyle};
22
+ pub use file_name_printer::FileNamePrinter;
20
23
  pub use interactive_print::InteractivePrinter;
21
24
  pub use json_print::{JSONPrinter, JsonStyle};
22
25
 
@@ -11,7 +11,8 @@ use ignore::WalkParallel;
11
11
  use crate::config::ProjectConfig;
12
12
  use crate::lang::SgLang;
13
13
  use crate::print::{
14
- ColoredPrinter, Diff, Heading, InteractivePrinter, JSONPrinter, PrintProcessor, Printer,
14
+ ColoredPrinter, Diff, FileNamePrinter, Heading, InteractivePrinter, JSONPrinter, PrintProcessor,
15
+ Printer,
15
16
  };
16
17
  use crate::utils::ErrorContext as EC;
17
18
  use crate::utils::{filter_file_pattern, ContextArgs, InputArgs, MatchUnit, OutputArgs};
@@ -151,6 +152,10 @@ pub fn run_with_pattern(arg: RunArg, project: Result<ProjectConfig>) -> Result<E
151
152
  let proj = arg.output.inspect.project_trace();
152
153
  proj.print_project(&project)?;
153
154
  let context = arg.context.get();
155
+ if arg.output.files_with_matches {
156
+ let printer = FileNamePrinter::stdout(arg.output.color);
157
+ return run_pattern_with_printer(arg, printer);
158
+ }
154
159
  if let Some(json) = arg.output.json {
155
160
  let printer = JSONPrinter::stdout(json).context(context);
156
161
  return run_pattern_with_printer(arg, printer);
@@ -415,6 +420,7 @@ mod test {
415
420
  color: ColorArg::Never,
416
421
  interactive: false,
417
422
  json: None,
423
+ files_with_matches: false,
418
424
  update_all: false,
419
425
  inspect: Default::default(),
420
426
  },
@@ -11,8 +11,8 @@ use ignore::WalkParallel;
11
11
  use crate::config::{read_rule_file, with_rule_stats, ProjectConfig};
12
12
  use crate::lang::SgLang;
13
13
  use crate::print::{
14
- CloudPrinter, ColoredPrinter, Diff, InteractivePrinter, JSONPrinter, Platform, PrintProcessor,
15
- Printer, ReportStyle, SimpleFile,
14
+ CloudPrinter, ColoredPrinter, Diff, FileNamePrinter, InteractivePrinter, JSONPrinter, Platform,
15
+ PrintProcessor, Printer, ReportStyle, SimpleFile,
16
16
  };
17
17
  use crate::utils::ErrorContext as EC;
18
18
  use crate::utils::RuleOverwrite;
@@ -80,6 +80,10 @@ pub fn run_with_config(arg: ScanArg, project: Result<ProjectConfig>) -> Result<E
80
80
  let project_trace = arg.output.inspect.project_trace();
81
81
  project_trace.print_project(&project)?;
82
82
  let context = arg.context.get();
83
+ if arg.output.files_with_matches {
84
+ let printer = FileNamePrinter::stdout(arg.output.color);
85
+ return run_scan(arg, printer, project);
86
+ }
83
87
  if let Some(format) = &arg.format {
84
88
  let printer = CloudPrinter::stdout(format.clone());
85
89
  return run_scan(arg, printer, project);
@@ -411,6 +415,7 @@ rule:
411
415
  output: OutputArgs {
412
416
  interactive: false,
413
417
  json: None,
418
+ files_with_matches: false,
414
419
  update_all: false,
415
420
  color: ColorArg::Never,
416
421
  inspect: Default::default(),
@@ -126,6 +126,15 @@ pub struct OutputArgs {
126
126
  #[clap(short = 'U', long)]
127
127
  pub update_all: bool,
128
128
 
129
+ /// Print only the paths with at least one match and suppress match contents.
130
+ ///
131
+ /// It conflicts with both the --interactive, --json and --update-all flags.
132
+ #[clap(
133
+ long,
134
+ conflicts_with_all = ["interactive", "json", "update_all"],
135
+ )]
136
+ pub files_with_matches: bool,
137
+
129
138
  /// Output matches in structured JSON.
130
139
  ///
131
140
  /// If this flag is set, ast-grep will output matches in JSON format.
@@ -1,14 +1,14 @@
1
1
  mod common;
2
2
 
3
3
  use anyhow::Result;
4
- use assert_cmd::Command;
4
+ use assert_cmd::{cargo_bin, Command};
5
5
  use common::create_test_files;
6
6
  use predicates::str::contains;
7
7
 
8
8
  #[test]
9
9
  fn test_help_work_for_invalid_sgconfig() -> Result<()> {
10
10
  let dir = create_test_files([("sgconfig.yml", "invalid")])?;
11
- Command::cargo_bin("ast-grep")?
11
+ Command::new(cargo_bin!())
12
12
  .current_dir(dir.path())
13
13
  .args(["help"])
14
14
  .assert()