polyglot-piranha 0.3.33__tar.gz → 0.3.35__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.
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/Cargo.lock +52 -52
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/Cargo.toml +2 -2
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/PKG-INFO +1 -1
- polyglot_piranha-0.3.35/polyglot_piranha.pyi +326 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/pyproject.toml +1 -1
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/LICENSE +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/NOTICE +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/README.md +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/plugins/pyproject.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/go/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/go/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/go/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java_cs/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java_cs/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java_cs/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/kt/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/kt/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/kt/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/ruby/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/ruby/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/ruby/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/scala/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/swift/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/swift/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/swift/scope_config.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/df/README.md +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/df/analysis.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/df/mod.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/df/tag_analysis.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/df/unit_tests/tag_analysis_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/df/utils.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/lib.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/main.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/capture_group_patterns.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/concrete_syntax.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/default_configs.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/edit.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/filter.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/language.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/matches.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/mod.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/outgoing_edges.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/piranha_arguments.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/piranha_output.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/rule.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/rule_graph.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/rule_store.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/scopes.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/source_code_unit.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/concrete_syntax_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/piranha_arguments_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/rule_graph_validation_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/rule_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/scopes_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/source_code_unit_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/testdata/custom_builtin/edges.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/testdata/custom_builtin/rules.toml +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/mod.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_go.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_java.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_kt.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_python.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_scala.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_scm.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_strings.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_swift.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_thrift.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_ts.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_tsx.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/tests/test_piranha_yaml.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/utilities/mod.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/utilities/regex_utilities.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/utilities/tree_sitter_utilities.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/utilities/unit_tests/tree_sitter_utilities_test.rs +0 -0
- {polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/utilities/unit_tests/utilities_test.rs +0 -0
@@ -13,9 +13,9 @@ dependencies = [
|
|
13
13
|
|
14
14
|
[[package]]
|
15
15
|
name = "anstream"
|
16
|
-
version = "0.6.
|
16
|
+
version = "0.6.19"
|
17
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
|
-
checksum = "
|
18
|
+
checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933"
|
19
19
|
dependencies = [
|
20
20
|
"anstyle",
|
21
21
|
"anstyle-parse",
|
@@ -28,33 +28,33 @@ dependencies = [
|
|
28
28
|
|
29
29
|
[[package]]
|
30
30
|
name = "anstyle"
|
31
|
-
version = "1.0.
|
31
|
+
version = "1.0.11"
|
32
32
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
33
|
-
checksum = "
|
33
|
+
checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd"
|
34
34
|
|
35
35
|
[[package]]
|
36
36
|
name = "anstyle-parse"
|
37
|
-
version = "0.2.
|
37
|
+
version = "0.2.7"
|
38
38
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
39
|
-
checksum = "
|
39
|
+
checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"
|
40
40
|
dependencies = [
|
41
41
|
"utf8parse",
|
42
42
|
]
|
43
43
|
|
44
44
|
[[package]]
|
45
45
|
name = "anstyle-query"
|
46
|
-
version = "1.1.
|
46
|
+
version = "1.1.3"
|
47
47
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
48
|
-
checksum = "
|
48
|
+
checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9"
|
49
49
|
dependencies = [
|
50
50
|
"windows-sys",
|
51
51
|
]
|
52
52
|
|
53
53
|
[[package]]
|
54
54
|
name = "anstyle-wincon"
|
55
|
-
version = "3.0.
|
55
|
+
version = "3.0.9"
|
56
56
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
57
|
-
checksum = "
|
57
|
+
checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882"
|
58
58
|
dependencies = [
|
59
59
|
"anstyle",
|
60
60
|
"once_cell_polyfill",
|
@@ -114,9 +114,9 @@ checksum = "066fce287b1d4eafef758e89e09d724a24808a9196fe9756b8ca90e86d0719a2"
|
|
114
114
|
|
115
115
|
[[package]]
|
116
116
|
name = "cfg-if"
|
117
|
-
version = "1.0.
|
117
|
+
version = "1.0.1"
|
118
118
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
119
|
-
checksum = "
|
119
|
+
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
120
120
|
|
121
121
|
[[package]]
|
122
122
|
name = "cfg_aliases"
|
@@ -126,9 +126,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
|
126
126
|
|
127
127
|
[[package]]
|
128
128
|
name = "clap"
|
129
|
-
version = "4.5.
|
129
|
+
version = "4.5.40"
|
130
130
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
131
|
-
checksum = "
|
131
|
+
checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f"
|
132
132
|
dependencies = [
|
133
133
|
"clap_builder",
|
134
134
|
"clap_derive",
|
@@ -136,9 +136,9 @@ dependencies = [
|
|
136
136
|
|
137
137
|
[[package]]
|
138
138
|
name = "clap_builder"
|
139
|
-
version = "4.5.
|
139
|
+
version = "4.5.40"
|
140
140
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
141
|
-
checksum = "
|
141
|
+
checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e"
|
142
142
|
dependencies = [
|
143
143
|
"anstream",
|
144
144
|
"anstyle",
|
@@ -148,27 +148,27 @@ dependencies = [
|
|
148
148
|
|
149
149
|
[[package]]
|
150
150
|
name = "clap_derive"
|
151
|
-
version = "4.5.
|
151
|
+
version = "4.5.40"
|
152
152
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
153
|
-
checksum = "
|
153
|
+
checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce"
|
154
154
|
dependencies = [
|
155
155
|
"heck 0.5.0",
|
156
156
|
"proc-macro2",
|
157
157
|
"quote",
|
158
|
-
"syn 2.0.
|
158
|
+
"syn 2.0.102",
|
159
159
|
]
|
160
160
|
|
161
161
|
[[package]]
|
162
162
|
name = "clap_lex"
|
163
|
-
version = "0.7.
|
163
|
+
version = "0.7.5"
|
164
164
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
165
|
-
checksum = "
|
165
|
+
checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
|
166
166
|
|
167
167
|
[[package]]
|
168
168
|
name = "colorchoice"
|
169
|
-
version = "1.0.
|
169
|
+
version = "1.0.4"
|
170
170
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
171
|
-
checksum = "
|
171
|
+
checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
|
172
172
|
|
173
173
|
[[package]]
|
174
174
|
name = "colored"
|
@@ -379,7 +379,7 @@ dependencies = [
|
|
379
379
|
"proc-macro-error2",
|
380
380
|
"proc-macro2",
|
381
381
|
"quote",
|
382
|
-
"syn 2.0.
|
382
|
+
"syn 2.0.102",
|
383
383
|
]
|
384
384
|
|
385
385
|
[[package]]
|
@@ -390,9 +390,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
|
|
390
390
|
|
391
391
|
[[package]]
|
392
392
|
name = "hashbrown"
|
393
|
-
version = "0.15.
|
393
|
+
version = "0.15.4"
|
394
394
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
395
|
-
checksum = "
|
395
|
+
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
|
396
396
|
|
397
397
|
[[package]]
|
398
398
|
name = "heck"
|
@@ -518,9 +518,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
|
518
518
|
|
519
519
|
[[package]]
|
520
520
|
name = "memchr"
|
521
|
-
version = "2.7.
|
521
|
+
version = "2.7.5"
|
522
522
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
523
|
-
checksum = "
|
523
|
+
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
|
524
524
|
|
525
525
|
[[package]]
|
526
526
|
name = "memoffset"
|
@@ -595,7 +595,7 @@ dependencies = [
|
|
595
595
|
|
596
596
|
[[package]]
|
597
597
|
name = "piranha"
|
598
|
-
version = "0.3.
|
598
|
+
version = "0.3.35"
|
599
599
|
dependencies = [
|
600
600
|
"assert_cmd",
|
601
601
|
"cc",
|
@@ -638,9 +638,9 @@ dependencies = [
|
|
638
638
|
|
639
639
|
[[package]]
|
640
640
|
name = "portable-atomic"
|
641
|
-
version = "1.11.
|
641
|
+
version = "1.11.1"
|
642
642
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
643
|
-
checksum = "
|
643
|
+
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
|
644
644
|
|
645
645
|
[[package]]
|
646
646
|
name = "predicates"
|
@@ -691,7 +691,7 @@ dependencies = [
|
|
691
691
|
"proc-macro-error-attr2",
|
692
692
|
"proc-macro2",
|
693
693
|
"quote",
|
694
|
-
"syn 2.0.
|
694
|
+
"syn 2.0.102",
|
695
695
|
]
|
696
696
|
|
697
697
|
[[package]]
|
@@ -761,7 +761,7 @@ dependencies = [
|
|
761
761
|
"proc-macro2",
|
762
762
|
"pyo3-macros-backend",
|
763
763
|
"quote",
|
764
|
-
"syn 2.0.
|
764
|
+
"syn 2.0.102",
|
765
765
|
]
|
766
766
|
|
767
767
|
[[package]]
|
@@ -774,7 +774,7 @@ dependencies = [
|
|
774
774
|
"proc-macro2",
|
775
775
|
"pyo3-build-config",
|
776
776
|
"quote",
|
777
|
-
"syn 2.0.
|
777
|
+
"syn 2.0.102",
|
778
778
|
]
|
779
779
|
|
780
780
|
[[package]]
|
@@ -919,7 +919,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
|
919
919
|
dependencies = [
|
920
920
|
"proc-macro2",
|
921
921
|
"quote",
|
922
|
-
"syn 2.0.
|
922
|
+
"syn 2.0.102",
|
923
923
|
]
|
924
924
|
|
925
925
|
[[package]]
|
@@ -936,18 +936,18 @@ dependencies = [
|
|
936
936
|
|
937
937
|
[[package]]
|
938
938
|
name = "serde_spanned"
|
939
|
-
version = "0.6.
|
939
|
+
version = "0.6.9"
|
940
940
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
941
|
-
checksum = "
|
941
|
+
checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
|
942
942
|
dependencies = [
|
943
943
|
"serde",
|
944
944
|
]
|
945
945
|
|
946
946
|
[[package]]
|
947
947
|
name = "smallvec"
|
948
|
-
version = "1.15.
|
948
|
+
version = "1.15.1"
|
949
949
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
950
|
-
checksum = "
|
950
|
+
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
951
951
|
|
952
952
|
[[package]]
|
953
953
|
name = "strsim"
|
@@ -974,9 +974,9 @@ dependencies = [
|
|
974
974
|
|
975
975
|
[[package]]
|
976
976
|
name = "syn"
|
977
|
-
version = "2.0.
|
977
|
+
version = "2.0.102"
|
978
978
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
979
|
-
checksum = "
|
979
|
+
checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462"
|
980
980
|
dependencies = [
|
981
981
|
"proc-macro2",
|
982
982
|
"quote",
|
@@ -1016,9 +1016,9 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"
|
|
1016
1016
|
|
1017
1017
|
[[package]]
|
1018
1018
|
name = "toml"
|
1019
|
-
version = "0.8.
|
1019
|
+
version = "0.8.23"
|
1020
1020
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1021
|
-
checksum = "
|
1021
|
+
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
|
1022
1022
|
dependencies = [
|
1023
1023
|
"serde",
|
1024
1024
|
"serde_spanned",
|
@@ -1028,18 +1028,18 @@ dependencies = [
|
|
1028
1028
|
|
1029
1029
|
[[package]]
|
1030
1030
|
name = "toml_datetime"
|
1031
|
-
version = "0.6.
|
1031
|
+
version = "0.6.11"
|
1032
1032
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1033
|
-
checksum = "
|
1033
|
+
checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
|
1034
1034
|
dependencies = [
|
1035
1035
|
"serde",
|
1036
1036
|
]
|
1037
1037
|
|
1038
1038
|
[[package]]
|
1039
1039
|
name = "toml_edit"
|
1040
|
-
version = "0.22.
|
1040
|
+
version = "0.22.27"
|
1041
1041
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1042
|
-
checksum = "
|
1042
|
+
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
1043
1043
|
dependencies = [
|
1044
1044
|
"indexmap",
|
1045
1045
|
"serde",
|
@@ -1051,9 +1051,9 @@ dependencies = [
|
|
1051
1051
|
|
1052
1052
|
[[package]]
|
1053
1053
|
name = "toml_write"
|
1054
|
-
version = "0.1.
|
1054
|
+
version = "0.1.2"
|
1055
1055
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1056
|
-
checksum = "
|
1056
|
+
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
|
1057
1057
|
|
1058
1058
|
[[package]]
|
1059
1059
|
name = "tree-sitter"
|
@@ -1068,7 +1068,7 @@ dependencies = [
|
|
1068
1068
|
[[package]]
|
1069
1069
|
name = "tree-sitter-go"
|
1070
1070
|
version = "0.20.0"
|
1071
|
-
source = "git+https://github.com/
|
1071
|
+
source = "git+https://github.com/danieltrt/tree-sitter-go.git?rev=ea5ceb716012db8813a2c05fab23c3a020988724#ea5ceb716012db8813a2c05fab23c3a020988724"
|
1072
1072
|
dependencies = [
|
1073
1073
|
"cc",
|
1074
1074
|
"tree-sitter",
|
@@ -1323,9 +1323,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|
1323
1323
|
|
1324
1324
|
[[package]]
|
1325
1325
|
name = "winnow"
|
1326
|
-
version = "0.7.
|
1326
|
+
version = "0.7.11"
|
1327
1327
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1328
|
-
checksum = "
|
1328
|
+
checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd"
|
1329
1329
|
dependencies = [
|
1330
1330
|
"memchr",
|
1331
1331
|
]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
authors = ["Uber Technologies Inc."]
|
3
3
|
name = "piranha"
|
4
4
|
description = "Polyglot Piranha is a library for performing structural find and replace with deep cleanup."
|
5
|
-
version = "0.3.
|
5
|
+
version = "0.3.35"
|
6
6
|
edition = "2021"
|
7
7
|
include = ["pyproject.toml", "src/"]
|
8
8
|
exclude = ["legacy"]
|
@@ -57,7 +57,7 @@ tree-sitter-python = "0.20.2"
|
|
57
57
|
tree-sitter-ruby = "0.20.1"
|
58
58
|
tree-sitter-typescript = "0.20.1"
|
59
59
|
# TODO: Update after https://github.com/tree-sitter/tree-sitter-go/pull/103 lands
|
60
|
-
tree-sitter-go = { git = "https://github.com/
|
60
|
+
tree-sitter-go = { git = "https://github.com/danieltrt/tree-sitter-go.git", rev = "ea5ceb716012db8813a2c05fab23c3a020988724" }
|
61
61
|
tree-sitter-thrift = "0.5.0"
|
62
62
|
tree-sitter-strings = { git = "https://github.com/uber/tree-sitter-strings.git" }
|
63
63
|
tree-sitter-query = "0.1.0"
|
@@ -0,0 +1,326 @@
|
|
1
|
+
# Copyright (c) 2023 Uber Technologies, Inc.
|
2
|
+
#
|
3
|
+
# <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
|
4
|
+
# except in compliance with the License. You may obtain a copy of the License at
|
5
|
+
# <p>http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
#
|
7
|
+
# <p>Unless required by applicable law or agreed to in writing, software distributed under the
|
8
|
+
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
9
|
+
# express or implied. See the License for the specific language governing permissions and
|
10
|
+
# limitations under the License.
|
11
|
+
|
12
|
+
from __future__ import annotations
|
13
|
+
from typing import List, Optional, Literal
|
14
|
+
|
15
|
+
# Languages that Piranha supports (see ./src/models/language.rs)
|
16
|
+
PiranhaLanguage = Literal["java", "kt", "kotlin", "go", "python", "swift", "typescript", "tsx", "thrift", "strings", "scm", "scala", "ruby", "yaml", "yml"]
|
17
|
+
|
18
|
+
|
19
|
+
def execute_piranha(piranha_argument: PiranhaArguments) -> list[PiranhaOutputSummary]:
|
20
|
+
"""
|
21
|
+
Executes piranha for the given `piranha_arguments` and returns `PiranhaOutputSummary` for each file analyzed by Piranha
|
22
|
+
Parameters
|
23
|
+
------------
|
24
|
+
piranha_arguments: Piranha Arguments
|
25
|
+
Configurations for piranha
|
26
|
+
Returns
|
27
|
+
------------
|
28
|
+
List of `PiranhaOutPutSummary`
|
29
|
+
"""
|
30
|
+
...
|
31
|
+
|
32
|
+
class PiranhaArguments:
|
33
|
+
"""
|
34
|
+
A class to capture Piranha's configurations
|
35
|
+
"""
|
36
|
+
|
37
|
+
def __init__(
|
38
|
+
self,
|
39
|
+
language: PiranhaLanguage,
|
40
|
+
paths_to_codebase: Optional[List[str]] = None,
|
41
|
+
include: Optional[List[str]] = None,
|
42
|
+
exclude: Optional[List[str]] = None,
|
43
|
+
substitutions: Optional[dict[str, str]] = None,
|
44
|
+
path_to_configurations: Optional[str] = None,
|
45
|
+
rule_graph: Optional[RuleGraph] = None,
|
46
|
+
code_snippet: Optional[str] = None,
|
47
|
+
dry_run: Optional[bool] = None,
|
48
|
+
cleanup_comments: Optional[bool] = None,
|
49
|
+
cleanup_comments_buffer: Optional[int] = None,
|
50
|
+
number_of_ancestors_in_parent_scope: Optional[int] = None,
|
51
|
+
delete_consecutive_new_lines: Optional[bool] = None,
|
52
|
+
global_tag_prefix: Optional[str] = "GLOBAL_TAG",
|
53
|
+
delete_file_if_empty: Optional[bool] = None,
|
54
|
+
path_to_output: Optional[str] = None,
|
55
|
+
allow_dirty_ast: Optional[bool] = None,
|
56
|
+
should_validate: Optional[bool] = None,
|
57
|
+
experiment_dyn: Optional[bool] = None,
|
58
|
+
path_to_custom_builtin_rules: Optional[str] = None,
|
59
|
+
):
|
60
|
+
"""
|
61
|
+
Constructs `PiranhaArguments`
|
62
|
+
|
63
|
+
Parameters
|
64
|
+
------------
|
65
|
+
language: PiranhaLanguage
|
66
|
+
the target language
|
67
|
+
paths_to_codebase: List[str]
|
68
|
+
Paths to source code folder or file
|
69
|
+
keyword arguments: _
|
70
|
+
substitutions (dict): Substitutions to instantiate the initial set of rules
|
71
|
+
path_to_configurations (str): Directory containing the configuration files - `piranha_arguments.toml`, `rules.toml`, and `edges.toml`
|
72
|
+
rule_graph (RuleGraph): The rule graph constructed via RuleGraph DSL
|
73
|
+
code_snippet (str): The input code snippet to transform
|
74
|
+
dry_run (bool): Disables in-place rewriting of code
|
75
|
+
cleanup_comments (bool): Enables deletion of associated comments
|
76
|
+
cleanup_comments_buffer (int): The number of lines to consider for cleaning up the comments
|
77
|
+
number_of_ancestors_in_parent_scope (int): The number of ancestors considered when PARENT rules
|
78
|
+
delete_consecutive_new_lines (bool): Replaces consecutive \ns with a \n
|
79
|
+
global_tag_prefix (str): the prefix for global tags
|
80
|
+
delete_file_if_empty (bool): User option that determines whether an empty file will be deleted
|
81
|
+
path_to_output (str): Path to the output json file
|
82
|
+
allow_dirty_ast (bool): Allows syntax errors in the input source code
|
83
|
+
path_to_custom_builtin_rules (str): If provided, the default built-in rules will be ignored
|
84
|
+
"""
|
85
|
+
...
|
86
|
+
|
87
|
+
class PiranhaOutputSummary:
|
88
|
+
"""
|
89
|
+
A class to represent Piranha's output
|
90
|
+
|
91
|
+
Attributes
|
92
|
+
----------
|
93
|
+
path: path to the file
|
94
|
+
content: content of the file after all the rewrites
|
95
|
+
matches: All the occurrences of "match-only" rules
|
96
|
+
rewrites: All the applied edits
|
97
|
+
"""
|
98
|
+
|
99
|
+
path: str
|
100
|
+
"path to the file"
|
101
|
+
|
102
|
+
original_content: str
|
103
|
+
"Original content of the file before any rewrites"
|
104
|
+
|
105
|
+
content: str
|
106
|
+
"Final content of the file after all the rewrites"
|
107
|
+
|
108
|
+
matches: list[tuple[str, Match]]
|
109
|
+
'All the occurrences of "match-only" rules'
|
110
|
+
|
111
|
+
rewrites: list[Edit]
|
112
|
+
"All the applied edits"
|
113
|
+
|
114
|
+
class Edit:
|
115
|
+
"""
|
116
|
+
A class to represent an edit performed by Piranha
|
117
|
+
|
118
|
+
Attributes
|
119
|
+
----------
|
120
|
+
p_match: The match representing the target site of the edit
|
121
|
+
replacement_string: The string to replace the substring encompassed by the match
|
122
|
+
matched_rule: The rule used for creating this match-replace
|
123
|
+
"""
|
124
|
+
|
125
|
+
p_match: Match
|
126
|
+
"The match representing the target site of the edit"
|
127
|
+
|
128
|
+
matched_rule: str
|
129
|
+
"The rule used for creating this match-replace"
|
130
|
+
|
131
|
+
replacement_string: str
|
132
|
+
"The string to replace the substring encompassed by the match"
|
133
|
+
|
134
|
+
class Match:
|
135
|
+
"""
|
136
|
+
A class to represent a match
|
137
|
+
|
138
|
+
Attributes
|
139
|
+
----------
|
140
|
+
matched_sting: Code snippet that matched
|
141
|
+
range: Range of the entire AST node captured by the match
|
142
|
+
matches: The mapping between tags and string representation of the AST captured
|
143
|
+
"""
|
144
|
+
|
145
|
+
matched_string: str
|
146
|
+
"Code snippet that matched"
|
147
|
+
|
148
|
+
range: Range
|
149
|
+
"Range of the entire AST node captured by the match"
|
150
|
+
|
151
|
+
matches: dict[str, str]
|
152
|
+
"The mapping between tags and string representation of the AST captured"
|
153
|
+
""
|
154
|
+
|
155
|
+
class Range:
|
156
|
+
"""A range of positions in a multi-line text document,
|
157
|
+
both in terms of bytes and of rows and columns.
|
158
|
+
"""
|
159
|
+
|
160
|
+
start_byte: int
|
161
|
+
end_byte: int
|
162
|
+
start_point: Point
|
163
|
+
end_point: Point
|
164
|
+
|
165
|
+
class Point:
|
166
|
+
row: int
|
167
|
+
column: int
|
168
|
+
|
169
|
+
class Filter:
|
170
|
+
"""A class to capture filters of a Piranha Rule"""
|
171
|
+
|
172
|
+
enclosing_node: TSQuery
|
173
|
+
"AST patterns that some ancestor node of the primary match should comply"
|
174
|
+
not_contains: list[TSQuery]
|
175
|
+
"AST patterns that SHOULD NOT match any subtree of node matching `enclosing_node` pattern"
|
176
|
+
contains: TSQuery
|
177
|
+
"AST pattern that SHOULD match subtrees of `enclosing_node`. " "Number of matches should be within the range of `at_least` and `at_most`."
|
178
|
+
at_least: int
|
179
|
+
"The minimum number of times the contains query should match in the enclosing node"
|
180
|
+
at_most: int
|
181
|
+
"The maximum number of times the contains query should match in the enclosing node"
|
182
|
+
child_count: int
|
183
|
+
"Number of named children under the primary matched node"
|
184
|
+
sibling_count: int
|
185
|
+
"Number of named siblings of the primary matched node"
|
186
|
+
def __init__(
|
187
|
+
self,
|
188
|
+
enclosing_node: Optional[str] = None,
|
189
|
+
not_enclosing_node: Optional[str] = None,
|
190
|
+
not_contains: list[str] = [],
|
191
|
+
contains: Optional[str] = None,
|
192
|
+
at_least: int = 1,
|
193
|
+
at_most: int = 4294967295, # u32::MAX
|
194
|
+
child_count: int = 4294967295, # u32::MAX
|
195
|
+
sibling_count: int = 4294967295, # u32::MAX
|
196
|
+
):
|
197
|
+
"""
|
198
|
+
Constructs `Filter`
|
199
|
+
|
200
|
+
Parameters
|
201
|
+
------------
|
202
|
+
enclosing_node: str
|
203
|
+
AST patterns that some ancestor node of the primary match should comply
|
204
|
+
not_contains: list[str]
|
205
|
+
AST patterns that should not match any subtree of node matching `enclosing_node` pattern
|
206
|
+
"""
|
207
|
+
...
|
208
|
+
|
209
|
+
class Rule:
|
210
|
+
"""A class to capture Piranha Rule"""
|
211
|
+
|
212
|
+
name: str
|
213
|
+
"Name of the rule"
|
214
|
+
query: TSQuery
|
215
|
+
"Tree-sitter query as string"
|
216
|
+
replace_node: str
|
217
|
+
"The tag corresponding to the node to be replaced"
|
218
|
+
replace_node_idx: str
|
219
|
+
"The i'th child of node corresponding to the replace_node tag will be replaced"
|
220
|
+
replace: str
|
221
|
+
"Replacement pattern"
|
222
|
+
groups: set[str]
|
223
|
+
"Group(s) to which the rule belongs"
|
224
|
+
holes: set[str]
|
225
|
+
"Holes that need to be filled, in order to instantiate a rule"
|
226
|
+
filters: set[Filter]
|
227
|
+
"Filters to test before applying a rule"
|
228
|
+
is_seed_rule: bool
|
229
|
+
"Marks a rule as a seed rule"
|
230
|
+
keep_comment_regexes: set[str]
|
231
|
+
"Make comment deleting optional"
|
232
|
+
|
233
|
+
def __init__(
|
234
|
+
self,
|
235
|
+
name: str,
|
236
|
+
query: Optional[str] = None,
|
237
|
+
replace_node: Optional[str] = None,
|
238
|
+
replace: Optional[str] = None,
|
239
|
+
groups: set[str] = set(),
|
240
|
+
holes: set[str] = set(),
|
241
|
+
filters: set[Filter] = set(),
|
242
|
+
is_seed_rule: bool = True,
|
243
|
+
keep_comment_regexes: Optional[set[str]] = None,
|
244
|
+
):
|
245
|
+
"""
|
246
|
+
Constructs `Rule`
|
247
|
+
|
248
|
+
Parameters
|
249
|
+
------------
|
250
|
+
name: str
|
251
|
+
Name of the rule
|
252
|
+
query: str
|
253
|
+
Tree-sitter query as string
|
254
|
+
replace_node: str
|
255
|
+
The tag corresponding to the node to be replaced
|
256
|
+
replace: str
|
257
|
+
Replacement pattern
|
258
|
+
groups: set[str]
|
259
|
+
Group(s) to which the rule belongs
|
260
|
+
holes: set[str]
|
261
|
+
Holes that need to be filled, in order to instantiate a rule
|
262
|
+
filters: set[Filter]
|
263
|
+
Filters to test before applying a rule
|
264
|
+
is_seed_rule: bool
|
265
|
+
Marks a rule as a seed rule
|
266
|
+
"""
|
267
|
+
...
|
268
|
+
|
269
|
+
class OutgoingEdges:
|
270
|
+
frm: str
|
271
|
+
"The source rule or group of rules"
|
272
|
+
to: list[str]
|
273
|
+
"The target edges or groups of edges"
|
274
|
+
scope: str
|
275
|
+
"The scope label for the edge"
|
276
|
+
|
277
|
+
def __init__(
|
278
|
+
self,
|
279
|
+
frm: str,
|
280
|
+
to: list[str],
|
281
|
+
scope: str,
|
282
|
+
):
|
283
|
+
"""
|
284
|
+
Constructs `OutgoingEdge`
|
285
|
+
|
286
|
+
Parameters
|
287
|
+
------------
|
288
|
+
frm: str
|
289
|
+
The source rule or group of rules
|
290
|
+
to: list[str]
|
291
|
+
The target edges or groups of edges
|
292
|
+
scope: str
|
293
|
+
The scope label for the edge
|
294
|
+
"""
|
295
|
+
...
|
296
|
+
|
297
|
+
class RuleGraph:
|
298
|
+
rules: list[Rule]
|
299
|
+
"The rules in the graph"
|
300
|
+
edges: list[OutgoingEdges]
|
301
|
+
"The edges in the graph"
|
302
|
+
graph: dict[str, list[tuple[str, str]]]
|
303
|
+
"The graph itself (as an adjacency list)"
|
304
|
+
|
305
|
+
def __init__(
|
306
|
+
self,
|
307
|
+
rules: list[Rule],
|
308
|
+
edges: list[OutgoingEdges],
|
309
|
+
):
|
310
|
+
"""
|
311
|
+
Constructs `OutgoingEdge`
|
312
|
+
|
313
|
+
Parameters
|
314
|
+
------------
|
315
|
+
rules: list[Rule]
|
316
|
+
The rules in the graph
|
317
|
+
edges: list[OutgoingEdges]
|
318
|
+
The edges in the graph
|
319
|
+
"""
|
320
|
+
...
|
321
|
+
|
322
|
+
class TSQuery:
|
323
|
+
"Captures a Tree sitter query"
|
324
|
+
def query(self):
|
325
|
+
"""The query"""
|
326
|
+
...
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java/scope_config.toml
RENAMED
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/java_cs/scope_config.toml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/ruby/scope_config.toml
RENAMED
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/scala/scope_config.toml
RENAMED
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/cleanup_rules/swift/scope_config.toml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/concrete_syntax_test.rs
RENAMED
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/piranha_arguments_test.rs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/models/unit_tests/source_code_unit_test.rs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{polyglot_piranha-0.3.33 → polyglot_piranha-0.3.35}/src/utilities/unit_tests/utilities_test.rs
RENAMED
File without changes
|