From 124aa78fea799f6b8d48493a4cce65ed26501038 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Wed, 10 Jul 2024 18:15:38 -0500 Subject: [PATCH 1/6] Fix typo and remove dup in doc (#237) Signed-off-by: Alex Ji --- crates/weaver_forge/README.md | 2 -- docs/developer-guide.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/weaver_forge/README.md b/crates/weaver_forge/README.md index 74557574..c07b8b3a 100644 --- a/crates/weaver_forge/README.md +++ b/crates/weaver_forge/README.md @@ -37,8 +37,6 @@ templates/ ... rust/ <-- Templates to generate the semantic conventions in Rust ... - go/ <-- Templates to generate the semantic conventions in Go - ... schema/ sdk-go/ <-- Templates to generate a Go Client SDK derived from the telemetry schema ... diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 86429e8e..19ad363d 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -14,7 +14,7 @@ To do so we recommend following [Creating a JSON output for your registry](#crea ## Templates - Tips and Tricks -When designing JINJA templates, you can make use the the `debug` function to output the context of the template at any point in time. Simply add `{{ debug(ctx.some_variable) }}` do your template and you'll get a +When designing JINJA templates, you can make use the `debug` function to output the context of the template at any point in time. Simply add `{{ debug(ctx.some_variable) }}` to your template and you'll get a JSON rendered view of whatever is passed into `debug` at that portion of the template. ## Policies - Tips and tricks From eec58739925b63f4d7240705c1dca7ae83daa473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:33:10 -0700 Subject: [PATCH 2/6] chore(deps): bump jaq-std from 1.5.0 to 1.5.1 (#232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [jaq-std](https://github.com/01mf02/jaq) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/01mf02/jaq/releases) - [Commits](https://github.com/01mf02/jaq/compare/v1.5.0...v1.5.1) --- updated-dependencies: - dependency-name: jaq-std dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laurent Quérel --- Cargo.lock | 4 ++-- crates/weaver_forge/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7d05e64..e39e2243 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1926,9 +1926,9 @@ dependencies = [ [[package]] name = "jaq-std" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddeea4693478ff1ed94db36cc93342f00a29b8331c7aa70eaf413babec067af" +checksum = "d6e83f491752a1bbc4fa05a8e80d4ce1139119f9c3fd8e3400b604776c2e0129" dependencies = [ "bincode", "jaq-parse", diff --git a/crates/weaver_forge/Cargo.toml b/crates/weaver_forge/Cargo.toml index 1a852d69..20dc380a 100644 --- a/crates/weaver_forge/Cargo.toml +++ b/crates/weaver_forge/Cargo.toml @@ -21,7 +21,7 @@ weaver_semconv = { path = "../weaver_semconv" } minijinja = { version = "2.0.1", features = ["loader", "custom_syntax", "debug", "json", "macros"] } convert_case = "0.6.0" jaq-core = "1.2.1" -jaq-std = "1.2.1" +jaq-std = "1.5.1" jaq-interpret = "1.2.1" jaq-parse = "1.0.2" indexmap = "2.2.6" From eba459ce84031c4b49d8c63956e6c53265b2e44c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:35:21 -0700 Subject: [PATCH 3/6] chore(deps): bump ureq from 2.9.7 to 2.10.0 (#233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [ureq](https://github.com/algesten/ureq) from 2.9.7 to 2.10.0. - [Changelog](https://github.com/algesten/ureq/blob/main/CHANGELOG.md) - [Commits](https://github.com/algesten/ureq/compare/2.9.7...2.10.0) --- updated-dependencies: - dependency-name: ureq dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laurent Quérel --- Cargo.lock | 32 +++++++++----------------------- Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e39e2243..5eae7470 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1731,7 +1731,7 @@ dependencies = [ "http", "hyper", "hyper-util", - "rustls 0.23.10", + "rustls", "rustls-pki-types", "tokio", "tokio-rustls", @@ -2605,7 +2605,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.10", + "rustls", "thiserror", "tokio", "tracing", @@ -2621,7 +2621,7 @@ dependencies = [ "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.23.10", + "rustls", "slab", "thiserror", "tinyvec", @@ -2865,7 +2865,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.10", + "rustls", "rustls-pemfile", "rustls-pki-types", "serde", @@ -2924,26 +2924,13 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - [[package]] name = "rustls" version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -3445,7 +3432,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls", "rustls-pki-types", "tokio", ] @@ -3647,17 +3634,16 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.7" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" +checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" dependencies = [ "base64 0.22.1", "flate2", "log", "once_cell", - "rustls 0.22.4", + "rustls", "rustls-pki-types", - "rustls-webpki", "url", "webpki-roots", ] diff --git a/Cargo.toml b/Cargo.toml index f6720eb6..d663295c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ serde = { version = "1.0.203", features = ["derive"] } serde_yaml = "0.9.32" serde_json = { version = "1.0.116"} thiserror = "1.0.58" -ureq = "2.9.7" +ureq = "2.10.0" regex = "1.10.5" rayon = "1.10.0" ordered-float = { version = "4.2.0", features = ["serde", "schemars"] } From 973847b02f5b1e43c7fd31a1c63e1d8b8fb27885 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:42:16 -0700 Subject: [PATCH 4/6] chore(deps): bump serde from 1.0.203 to 1.0.204 (#234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laurent Quérel --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5eae7470..4fba5093 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3048,18 +3048,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index d663295c..fc02cc7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ publish = false rust-version = "1.76" [workspace.dependencies] -serde = { version = "1.0.203", features = ["derive"] } +serde = { version = "1.0.204", features = ["derive"] } serde_yaml = "0.9.32" serde_json = { version = "1.0.116"} thiserror = "1.0.58" From 949dee79fe99300e9c84f50897f4d81678b2913d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:53:46 -0700 Subject: [PATCH 5/6] chore(deps): bump clap from 4.5.8 to 4.5.9 (#235) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [clap](https://github.com/clap-rs/clap) from 4.5.8 to 4.5.9. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.5.8...v4.5.9) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laurent Quérel --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fba5093..e0806d9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -341,9 +341,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -351,9 +351,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", diff --git a/Cargo.toml b/Cargo.toml index fc02cc7c..e6aad893 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ weaver_cache = { path = "crates/weaver_cache" } weaver_forge = { path = "crates/weaver_forge" } weaver_checker = { path = "crates/weaver_checker" } -clap = { version = "4.5.7", features = ["derive"] } +clap = { version = "4.5.9", features = ["derive"] } # workspace dependencies serde.workspace = true From ece8753f6869acf5c5bd991575ed83dbaf19e8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Qu=C3=A9rel?= Date: Mon, 15 Jul 2024 09:46:17 -0700 Subject: [PATCH 6/6] feat(forge): Add support for minijinja py_compat extensions (e.g. startswith, endswith, ...) (#239) --- Cargo.lock | 134 ++++++++++-------- Cargo.toml | 3 +- README.md | 6 + crates/weaver_forge/Cargo.toml | 3 +- crates/weaver_forge/README.md | 3 +- .../expected_output/py_compat/test | 6 + .../attribute_group/attributes_jvm_memory.md | 0 .../{ => test}/attribute_group/registry_db.md | 0 .../attribute_group/registry_http.md | 0 .../attribute_group/registry_network.md | 0 .../attribute_group/registry_url.md | 0 .../attribute_group/registry_user_agent.md | 0 .../{ => test}/attribute_group/server.md | 0 .../{ => test}/attribute_groups.md | 0 .../expected_output/{ => test}/converter.md | 0 .../event/android_lifecycle_events.md | 0 .../{ => test}/event/ios_lifecycle_events.md | 0 .../expected_output/{ => test}/events.md | 0 .../group/android_lifecycle_events.md | 0 .../{ => test}/group/attributes_jvm_memory.md | 0 .../expected_output/{ => test}/group/db.md | 0 .../{ => test}/group/db_cassandra.md | 0 .../{ => test}/group/db_cosmosdb.md | 0 .../{ => test}/group/db_couchdb.md | 0 .../{ => test}/group/db_elasticsearch.md | 0 .../{ => test}/group/db_hbase.md | 0 .../{ => test}/group/db_mongodb.md | 0 .../{ => test}/group/db_mssql.md | 0 .../{ => test}/group/db_redis.md | 0 .../{ => test}/group/db_sql.md | 0 .../{ => test}/group/db_tech.md | 0 .../{ => test}/group/ios_lifecycle_events.md | 0 .../group/metric_jvm_class_count.md | 0 .../group/metric_jvm_class_loaded.md | 0 .../group/metric_jvm_class_unloaded.md | 0 .../{ => test}/group/metric_jvm_cpu_count.md | 0 .../metric_jvm_cpu_recent_utilization.md | 0 .../{ => test}/group/metric_jvm_cpu_time.md | 0 .../group/metric_jvm_gc_duration.md | 0 .../group/metric_jvm_memory_committed.md | 0 .../group/metric_jvm_memory_limit.md | 0 .../group/metric_jvm_memory_used.md | 0 .../metric_jvm_memory_used_after_last_gc.md | 0 .../group/metric_jvm_thread_count.md | 0 .../{ => test}/group/otel_library.md | 0 .../{ => test}/group/otel_scope.md | 0 .../{ => test}/group/registry_db.md | 0 .../{ => test}/group/registry_http.md | 0 .../{ => test}/group/registry_network.md | 0 .../{ => test}/group/registry_url.md | 0 .../{ => test}/group/registry_user_agent.md | 0 .../{ => test}/group/server.md | 0 .../expected_output/{ => test}/groups.md | 0 .../metric/metric_jvm_class_count.md | 0 .../metric/metric_jvm_class_loaded.md | 0 .../metric/metric_jvm_class_unloaded.md | 0 .../{ => test}/metric/metric_jvm_cpu_count.md | 0 .../metric_jvm_cpu_recent_utilization.md | 0 .../{ => test}/metric/metric_jvm_cpu_time.md | 0 .../metric/metric_jvm_gc_duration.md | 0 .../metric/metric_jvm_memory_committed.md | 0 .../metric/metric_jvm_memory_limit.md | 0 .../metric/metric_jvm_memory_used.md | 0 .../metric_jvm_memory_used_after_last_gc.md | 0 .../metric/metric_jvm_thread_count.md | 0 .../expected_output/{ => test}/metrics.md | 0 .../expected_output/{ => test}/registry.md | 0 .../{ => test}/resource/otel_library.md | 0 .../{ => test}/resource/otel_scope.md | 0 .../expected_output/{ => test}/resources.md | 0 .../expected_output/{ => test}/span/db.md | 0 .../{ => test}/span/db_cassandra.md | 0 .../{ => test}/span/db_cosmosdb.md | 0 .../{ => test}/span/db_couchdb.md | 0 .../{ => test}/span/db_elasticsearch.md | 0 .../{ => test}/span/db_hbase.md | 0 .../{ => test}/span/db_mongodb.md | 0 .../{ => test}/span/db_mssql.md | 0 .../{ => test}/span/db_redis.md | 0 .../expected_output/{ => test}/span/db_sql.md | 0 .../{ => test}/span/db_tech.md | 0 .../expected_output/{ => test}/spans.md | 0 .../whitespace_control}/registry.md | 0 crates/weaver_forge/src/lib.rs | 49 ++++++- crates/weaver_forge/templates/py_compat/test | 6 + .../templates/py_compat/weaver.yaml | 4 + .../whitespace_control}/registry.md | 0 .../whitespace_control}/weaver.yaml | 0 88 files changed, 144 insertions(+), 70 deletions(-) create mode 100644 crates/weaver_forge/expected_output/py_compat/test rename crates/weaver_forge/expected_output/{ => test}/attribute_group/attributes_jvm_memory.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_group/registry_db.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_group/registry_http.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_group/registry_network.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_group/registry_url.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_group/registry_user_agent.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_group/server.md (100%) rename crates/weaver_forge/expected_output/{ => test}/attribute_groups.md (100%) rename crates/weaver_forge/expected_output/{ => test}/converter.md (100%) rename crates/weaver_forge/expected_output/{ => test}/event/android_lifecycle_events.md (100%) rename crates/weaver_forge/expected_output/{ => test}/event/ios_lifecycle_events.md (100%) rename crates/weaver_forge/expected_output/{ => test}/events.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/android_lifecycle_events.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/attributes_jvm_memory.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_cassandra.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_cosmosdb.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_couchdb.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_elasticsearch.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_hbase.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_mongodb.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_mssql.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_redis.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_sql.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/db_tech.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/ios_lifecycle_events.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_class_count.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_class_loaded.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_class_unloaded.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_cpu_count.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_cpu_recent_utilization.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_cpu_time.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_gc_duration.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_memory_committed.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_memory_limit.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_memory_used.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_memory_used_after_last_gc.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/metric_jvm_thread_count.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/otel_library.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/otel_scope.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/registry_db.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/registry_http.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/registry_network.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/registry_url.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/registry_user_agent.md (100%) rename crates/weaver_forge/expected_output/{ => test}/group/server.md (100%) rename crates/weaver_forge/expected_output/{ => test}/groups.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_class_count.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_class_loaded.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_class_unloaded.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_cpu_count.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_cpu_recent_utilization.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_cpu_time.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_gc_duration.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_memory_committed.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_memory_limit.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_memory_used.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_memory_used_after_last_gc.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metric/metric_jvm_thread_count.md (100%) rename crates/weaver_forge/expected_output/{ => test}/metrics.md (100%) rename crates/weaver_forge/expected_output/{ => test}/registry.md (100%) rename crates/weaver_forge/expected_output/{ => test}/resource/otel_library.md (100%) rename crates/weaver_forge/expected_output/{ => test}/resource/otel_scope.md (100%) rename crates/weaver_forge/expected_output/{ => test}/resources.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_cassandra.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_cosmosdb.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_couchdb.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_elasticsearch.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_hbase.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_mongodb.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_mssql.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_redis.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_sql.md (100%) rename crates/weaver_forge/expected_output/{ => test}/span/db_tech.md (100%) rename crates/weaver_forge/expected_output/{ => test}/spans.md (100%) rename crates/weaver_forge/{whitespace_control_templates/test/expected_output => expected_output/whitespace_control}/registry.md (100%) create mode 100644 crates/weaver_forge/templates/py_compat/test create mode 100644 crates/weaver_forge/templates/py_compat/weaver.yaml rename crates/weaver_forge/{whitespace_control_templates/test => templates/whitespace_control}/registry.md (100%) rename crates/weaver_forge/{whitespace_control_templates/test => templates/whitespace_control}/weaver.yaml (100%) diff --git a/Cargo.lock b/Cargo.lock index e0806d9b..2a90b4e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,9 +145,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", @@ -284,9 +284,9 @@ checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] name = "cc" -version = "1.0.104" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "907d8581360765417f8f2e0e7d602733bbed60156b4465b7617243689ef9b83d" [[package]] name = "cfg-if" @@ -305,7 +305,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -862,9 +862,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.3" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f52455500a0fac1fd62a1cf42d9121cfddef8cb3ded2f9e7adb5775deb1fc9" +checksum = "d9b8ee65074b2bbb91d9d97c15d172ea75043aefebf9869b5b329149dc76501c" dependencies = [ "bstr", "gix-date", @@ -1196,9 +1196,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.2" +version = "0.42.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe2dc4a41191c680c942e6ebd630c8107005983c4679214fdb1007dcf5ae1df" +checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" dependencies = [ "bstr", "gix-actor", @@ -1668,9 +1668,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", @@ -1703,9 +1703,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -2162,11 +2162,22 @@ checksum = "933ee10775d58fca8238a84fe165dfe4bde8b07d7574f24d76ffea91170f3ac6" dependencies = [ "aho-corasick", "memo-map", + "percent-encoding", "self_cell", "serde", "serde_json", ] +[[package]] +name = "minijinja-contrib" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "237307aea18e4cc6b3ba0d190ee46f06ff82944a99cc895f04e4c94ccbf121d9" +dependencies = [ + "minijinja", + "serde", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2429,7 +2440,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2926,9 +2937,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ "log", "once_cell", @@ -2957,9 +2968,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring", "rustls-pki-types", @@ -3258,9 +3269,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.68" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -3345,18 +3356,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", @@ -3398,9 +3409,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -3473,9 +3484,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.14" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap", "serde", @@ -3673,9 +3684,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", "rand 0.8.5", @@ -3904,6 +3915,7 @@ dependencies = [ "markdown", "miette", "minijinja", + "minijinja-contrib", "opentelemetry 0.22.0", "opentelemetry-stdout", "opentelemetry_sdk", @@ -4053,7 +4065,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4071,7 +4083,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4091,18 +4103,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4113,9 +4125,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4125,9 +4137,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4137,15 +4149,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4155,9 +4167,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4167,9 +4179,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4179,9 +4191,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4191,9 +4203,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -4224,18 +4236,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index e6aad893..9362227d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -183,7 +183,8 @@ redundant_feature_names = "warn" ref_option_ref = "warn" rest_pat_in_fully_bound_structs = "warn" same_functions_in_if_condition = "warn" -self_named_module_files = "warn" +# disabled due to false positives +# self_named_module_files = "warn" semicolon_if_nothing_returned = "warn" single_match_else = "warn" string_add = "warn" diff --git a/README.md b/README.md index 3aafabdb..80952e27 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,12 @@ [Getting started](#getting-started) | [Main commands](#main-commands) | [Generate Doc & Code](crates/weaver_forge/README.md) | [Architecture](docs/architecture.md) | [Change log](CHANGELOG.md) | [Contributing](CONTRIBUTING.md) | [Links](#links) | +> [!NOTE] +> Codegen authors, please refer to the following documentation to learn how to +> use Weaver for generating code from semantic conventions: +> - [Templates organization, integrated Jinja2 engine, list of supported filters/functions/tests](crates/weaver_forge/README.md) +> - [Weaver Configuration](docs/weaver-config.md) + ## What is OpenTelemetry Weaver? **OTel Weaver** is a comprehensive tool designed to enable developers to diff --git a/crates/weaver_forge/Cargo.toml b/crates/weaver_forge/Cargo.toml index 20dc380a..e82818d7 100644 --- a/crates/weaver_forge/Cargo.toml +++ b/crates/weaver_forge/Cargo.toml @@ -18,7 +18,8 @@ weaver_resolver = { path = "../weaver_resolver" } weaver_resolved_schema = { path = "../weaver_resolved_schema" } weaver_semconv = { path = "../weaver_semconv" } -minijinja = { version = "2.0.1", features = ["loader", "custom_syntax", "debug", "json", "macros"] } +minijinja = { version = "2.0.3", features = ["loader", "custom_syntax", "debug", "json", "urlencode", "macros"] } +minijinja-contrib = { version="2.0.3", features = ["pycompat"] } convert_case = "0.6.0" jaq-core = "1.2.1" jaq-std = "1.5.1" diff --git a/crates/weaver_forge/README.md b/crates/weaver_forge/README.md index c07b8b3a..4705d32a 100644 --- a/crates/weaver_forge/README.md +++ b/crates/weaver_forge/README.md @@ -129,7 +129,8 @@ Jinja templates can also access the parameters: ## Jinja Filters All the filters available in the MiniJinja template engine are available (see -this online [documentation](https://docs.rs/minijinja/latest/minijinja/filters/index.html)). +this online [documentation](https://docs.rs/minijinja/latest/minijinja/filters/index.html)) and the [py_compat](https://github.com/mitsuhiko/minijinja/blob/e8a7ec5198deef7638267f2667714198ef64a1db/minijinja-contrib/src/pycompat.rs) compatibility extensions +that are also enabled in Weaver. In addition, OTel Weaver provides a set of custom filters to facilitate the generation of documentation and code. diff --git a/crates/weaver_forge/expected_output/py_compat/test b/crates/weaver_forge/expected_output/py_compat/test new file mode 100644 index 00000000..1aae0b1b --- /dev/null +++ b/crates/weaver_forge/expected_output/py_compat/test @@ -0,0 +1,6 @@ +Test integration with `py_compat` functions + +"Hello, World!".startswith("Hello") => true +"Hello, World!".startswith("Bonjour") => false +"Hello, World!".endswith("World!") => true +"Hello, World!".endswith("Monde!") => false \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/attribute_group/attributes_jvm_memory.md b/crates/weaver_forge/expected_output/test/attribute_group/attributes_jvm_memory.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/attributes_jvm_memory.md rename to crates/weaver_forge/expected_output/test/attribute_group/attributes_jvm_memory.md diff --git a/crates/weaver_forge/expected_output/attribute_group/registry_db.md b/crates/weaver_forge/expected_output/test/attribute_group/registry_db.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/registry_db.md rename to crates/weaver_forge/expected_output/test/attribute_group/registry_db.md diff --git a/crates/weaver_forge/expected_output/attribute_group/registry_http.md b/crates/weaver_forge/expected_output/test/attribute_group/registry_http.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/registry_http.md rename to crates/weaver_forge/expected_output/test/attribute_group/registry_http.md diff --git a/crates/weaver_forge/expected_output/attribute_group/registry_network.md b/crates/weaver_forge/expected_output/test/attribute_group/registry_network.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/registry_network.md rename to crates/weaver_forge/expected_output/test/attribute_group/registry_network.md diff --git a/crates/weaver_forge/expected_output/attribute_group/registry_url.md b/crates/weaver_forge/expected_output/test/attribute_group/registry_url.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/registry_url.md rename to crates/weaver_forge/expected_output/test/attribute_group/registry_url.md diff --git a/crates/weaver_forge/expected_output/attribute_group/registry_user_agent.md b/crates/weaver_forge/expected_output/test/attribute_group/registry_user_agent.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/registry_user_agent.md rename to crates/weaver_forge/expected_output/test/attribute_group/registry_user_agent.md diff --git a/crates/weaver_forge/expected_output/attribute_group/server.md b/crates/weaver_forge/expected_output/test/attribute_group/server.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_group/server.md rename to crates/weaver_forge/expected_output/test/attribute_group/server.md diff --git a/crates/weaver_forge/expected_output/attribute_groups.md b/crates/weaver_forge/expected_output/test/attribute_groups.md similarity index 100% rename from crates/weaver_forge/expected_output/attribute_groups.md rename to crates/weaver_forge/expected_output/test/attribute_groups.md diff --git a/crates/weaver_forge/expected_output/converter.md b/crates/weaver_forge/expected_output/test/converter.md similarity index 100% rename from crates/weaver_forge/expected_output/converter.md rename to crates/weaver_forge/expected_output/test/converter.md diff --git a/crates/weaver_forge/expected_output/event/android_lifecycle_events.md b/crates/weaver_forge/expected_output/test/event/android_lifecycle_events.md similarity index 100% rename from crates/weaver_forge/expected_output/event/android_lifecycle_events.md rename to crates/weaver_forge/expected_output/test/event/android_lifecycle_events.md diff --git a/crates/weaver_forge/expected_output/event/ios_lifecycle_events.md b/crates/weaver_forge/expected_output/test/event/ios_lifecycle_events.md similarity index 100% rename from crates/weaver_forge/expected_output/event/ios_lifecycle_events.md rename to crates/weaver_forge/expected_output/test/event/ios_lifecycle_events.md diff --git a/crates/weaver_forge/expected_output/events.md b/crates/weaver_forge/expected_output/test/events.md similarity index 100% rename from crates/weaver_forge/expected_output/events.md rename to crates/weaver_forge/expected_output/test/events.md diff --git a/crates/weaver_forge/expected_output/group/android_lifecycle_events.md b/crates/weaver_forge/expected_output/test/group/android_lifecycle_events.md similarity index 100% rename from crates/weaver_forge/expected_output/group/android_lifecycle_events.md rename to crates/weaver_forge/expected_output/test/group/android_lifecycle_events.md diff --git a/crates/weaver_forge/expected_output/group/attributes_jvm_memory.md b/crates/weaver_forge/expected_output/test/group/attributes_jvm_memory.md similarity index 100% rename from crates/weaver_forge/expected_output/group/attributes_jvm_memory.md rename to crates/weaver_forge/expected_output/test/group/attributes_jvm_memory.md diff --git a/crates/weaver_forge/expected_output/group/db.md b/crates/weaver_forge/expected_output/test/group/db.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db.md rename to crates/weaver_forge/expected_output/test/group/db.md diff --git a/crates/weaver_forge/expected_output/group/db_cassandra.md b/crates/weaver_forge/expected_output/test/group/db_cassandra.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_cassandra.md rename to crates/weaver_forge/expected_output/test/group/db_cassandra.md diff --git a/crates/weaver_forge/expected_output/group/db_cosmosdb.md b/crates/weaver_forge/expected_output/test/group/db_cosmosdb.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_cosmosdb.md rename to crates/weaver_forge/expected_output/test/group/db_cosmosdb.md diff --git a/crates/weaver_forge/expected_output/group/db_couchdb.md b/crates/weaver_forge/expected_output/test/group/db_couchdb.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_couchdb.md rename to crates/weaver_forge/expected_output/test/group/db_couchdb.md diff --git a/crates/weaver_forge/expected_output/group/db_elasticsearch.md b/crates/weaver_forge/expected_output/test/group/db_elasticsearch.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_elasticsearch.md rename to crates/weaver_forge/expected_output/test/group/db_elasticsearch.md diff --git a/crates/weaver_forge/expected_output/group/db_hbase.md b/crates/weaver_forge/expected_output/test/group/db_hbase.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_hbase.md rename to crates/weaver_forge/expected_output/test/group/db_hbase.md diff --git a/crates/weaver_forge/expected_output/group/db_mongodb.md b/crates/weaver_forge/expected_output/test/group/db_mongodb.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_mongodb.md rename to crates/weaver_forge/expected_output/test/group/db_mongodb.md diff --git a/crates/weaver_forge/expected_output/group/db_mssql.md b/crates/weaver_forge/expected_output/test/group/db_mssql.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_mssql.md rename to crates/weaver_forge/expected_output/test/group/db_mssql.md diff --git a/crates/weaver_forge/expected_output/group/db_redis.md b/crates/weaver_forge/expected_output/test/group/db_redis.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_redis.md rename to crates/weaver_forge/expected_output/test/group/db_redis.md diff --git a/crates/weaver_forge/expected_output/group/db_sql.md b/crates/weaver_forge/expected_output/test/group/db_sql.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_sql.md rename to crates/weaver_forge/expected_output/test/group/db_sql.md diff --git a/crates/weaver_forge/expected_output/group/db_tech.md b/crates/weaver_forge/expected_output/test/group/db_tech.md similarity index 100% rename from crates/weaver_forge/expected_output/group/db_tech.md rename to crates/weaver_forge/expected_output/test/group/db_tech.md diff --git a/crates/weaver_forge/expected_output/group/ios_lifecycle_events.md b/crates/weaver_forge/expected_output/test/group/ios_lifecycle_events.md similarity index 100% rename from crates/weaver_forge/expected_output/group/ios_lifecycle_events.md rename to crates/weaver_forge/expected_output/test/group/ios_lifecycle_events.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_class_count.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_class_count.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_class_count.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_class_count.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_class_loaded.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_class_loaded.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_class_loaded.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_class_loaded.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_class_unloaded.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_class_unloaded.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_class_unloaded.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_class_unloaded.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_cpu_count.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_count.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_cpu_count.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_count.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_cpu_recent_utilization.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_recent_utilization.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_cpu_recent_utilization.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_recent_utilization.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_cpu_time.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_time.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_cpu_time.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_time.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_gc_duration.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_gc_duration.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_gc_duration.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_gc_duration.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_memory_committed.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_committed.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_memory_committed.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_memory_committed.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_memory_limit.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_limit.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_memory_limit.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_memory_limit.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_memory_used.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_memory_used.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_memory_used_after_last_gc.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used_after_last_gc.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_memory_used_after_last_gc.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used_after_last_gc.md diff --git a/crates/weaver_forge/expected_output/group/metric_jvm_thread_count.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_thread_count.md similarity index 100% rename from crates/weaver_forge/expected_output/group/metric_jvm_thread_count.md rename to crates/weaver_forge/expected_output/test/group/metric_jvm_thread_count.md diff --git a/crates/weaver_forge/expected_output/group/otel_library.md b/crates/weaver_forge/expected_output/test/group/otel_library.md similarity index 100% rename from crates/weaver_forge/expected_output/group/otel_library.md rename to crates/weaver_forge/expected_output/test/group/otel_library.md diff --git a/crates/weaver_forge/expected_output/group/otel_scope.md b/crates/weaver_forge/expected_output/test/group/otel_scope.md similarity index 100% rename from crates/weaver_forge/expected_output/group/otel_scope.md rename to crates/weaver_forge/expected_output/test/group/otel_scope.md diff --git a/crates/weaver_forge/expected_output/group/registry_db.md b/crates/weaver_forge/expected_output/test/group/registry_db.md similarity index 100% rename from crates/weaver_forge/expected_output/group/registry_db.md rename to crates/weaver_forge/expected_output/test/group/registry_db.md diff --git a/crates/weaver_forge/expected_output/group/registry_http.md b/crates/weaver_forge/expected_output/test/group/registry_http.md similarity index 100% rename from crates/weaver_forge/expected_output/group/registry_http.md rename to crates/weaver_forge/expected_output/test/group/registry_http.md diff --git a/crates/weaver_forge/expected_output/group/registry_network.md b/crates/weaver_forge/expected_output/test/group/registry_network.md similarity index 100% rename from crates/weaver_forge/expected_output/group/registry_network.md rename to crates/weaver_forge/expected_output/test/group/registry_network.md diff --git a/crates/weaver_forge/expected_output/group/registry_url.md b/crates/weaver_forge/expected_output/test/group/registry_url.md similarity index 100% rename from crates/weaver_forge/expected_output/group/registry_url.md rename to crates/weaver_forge/expected_output/test/group/registry_url.md diff --git a/crates/weaver_forge/expected_output/group/registry_user_agent.md b/crates/weaver_forge/expected_output/test/group/registry_user_agent.md similarity index 100% rename from crates/weaver_forge/expected_output/group/registry_user_agent.md rename to crates/weaver_forge/expected_output/test/group/registry_user_agent.md diff --git a/crates/weaver_forge/expected_output/group/server.md b/crates/weaver_forge/expected_output/test/group/server.md similarity index 100% rename from crates/weaver_forge/expected_output/group/server.md rename to crates/weaver_forge/expected_output/test/group/server.md diff --git a/crates/weaver_forge/expected_output/groups.md b/crates/weaver_forge/expected_output/test/groups.md similarity index 100% rename from crates/weaver_forge/expected_output/groups.md rename to crates/weaver_forge/expected_output/test/groups.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_class_count.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_count.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_class_count.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_class_count.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_class_loaded.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_loaded.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_class_loaded.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_class_loaded.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_class_unloaded.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_unloaded.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_class_unloaded.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_class_unloaded.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_cpu_count.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_count.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_cpu_count.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_count.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_cpu_recent_utilization.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_recent_utilization.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_cpu_recent_utilization.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_recent_utilization.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_cpu_time.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_time.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_cpu_time.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_time.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_gc_duration.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_gc_duration.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_gc_duration.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_gc_duration.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_memory_committed.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_committed.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_memory_committed.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_committed.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_memory_limit.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_limit.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_memory_limit.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_limit.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_memory_used.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_memory_used.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_memory_used_after_last_gc.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used_after_last_gc.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_memory_used_after_last_gc.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used_after_last_gc.md diff --git a/crates/weaver_forge/expected_output/metric/metric_jvm_thread_count.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_thread_count.md similarity index 100% rename from crates/weaver_forge/expected_output/metric/metric_jvm_thread_count.md rename to crates/weaver_forge/expected_output/test/metric/metric_jvm_thread_count.md diff --git a/crates/weaver_forge/expected_output/metrics.md b/crates/weaver_forge/expected_output/test/metrics.md similarity index 100% rename from crates/weaver_forge/expected_output/metrics.md rename to crates/weaver_forge/expected_output/test/metrics.md diff --git a/crates/weaver_forge/expected_output/registry.md b/crates/weaver_forge/expected_output/test/registry.md similarity index 100% rename from crates/weaver_forge/expected_output/registry.md rename to crates/weaver_forge/expected_output/test/registry.md diff --git a/crates/weaver_forge/expected_output/resource/otel_library.md b/crates/weaver_forge/expected_output/test/resource/otel_library.md similarity index 100% rename from crates/weaver_forge/expected_output/resource/otel_library.md rename to crates/weaver_forge/expected_output/test/resource/otel_library.md diff --git a/crates/weaver_forge/expected_output/resource/otel_scope.md b/crates/weaver_forge/expected_output/test/resource/otel_scope.md similarity index 100% rename from crates/weaver_forge/expected_output/resource/otel_scope.md rename to crates/weaver_forge/expected_output/test/resource/otel_scope.md diff --git a/crates/weaver_forge/expected_output/resources.md b/crates/weaver_forge/expected_output/test/resources.md similarity index 100% rename from crates/weaver_forge/expected_output/resources.md rename to crates/weaver_forge/expected_output/test/resources.md diff --git a/crates/weaver_forge/expected_output/span/db.md b/crates/weaver_forge/expected_output/test/span/db.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db.md rename to crates/weaver_forge/expected_output/test/span/db.md diff --git a/crates/weaver_forge/expected_output/span/db_cassandra.md b/crates/weaver_forge/expected_output/test/span/db_cassandra.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_cassandra.md rename to crates/weaver_forge/expected_output/test/span/db_cassandra.md diff --git a/crates/weaver_forge/expected_output/span/db_cosmosdb.md b/crates/weaver_forge/expected_output/test/span/db_cosmosdb.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_cosmosdb.md rename to crates/weaver_forge/expected_output/test/span/db_cosmosdb.md diff --git a/crates/weaver_forge/expected_output/span/db_couchdb.md b/crates/weaver_forge/expected_output/test/span/db_couchdb.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_couchdb.md rename to crates/weaver_forge/expected_output/test/span/db_couchdb.md diff --git a/crates/weaver_forge/expected_output/span/db_elasticsearch.md b/crates/weaver_forge/expected_output/test/span/db_elasticsearch.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_elasticsearch.md rename to crates/weaver_forge/expected_output/test/span/db_elasticsearch.md diff --git a/crates/weaver_forge/expected_output/span/db_hbase.md b/crates/weaver_forge/expected_output/test/span/db_hbase.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_hbase.md rename to crates/weaver_forge/expected_output/test/span/db_hbase.md diff --git a/crates/weaver_forge/expected_output/span/db_mongodb.md b/crates/weaver_forge/expected_output/test/span/db_mongodb.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_mongodb.md rename to crates/weaver_forge/expected_output/test/span/db_mongodb.md diff --git a/crates/weaver_forge/expected_output/span/db_mssql.md b/crates/weaver_forge/expected_output/test/span/db_mssql.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_mssql.md rename to crates/weaver_forge/expected_output/test/span/db_mssql.md diff --git a/crates/weaver_forge/expected_output/span/db_redis.md b/crates/weaver_forge/expected_output/test/span/db_redis.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_redis.md rename to crates/weaver_forge/expected_output/test/span/db_redis.md diff --git a/crates/weaver_forge/expected_output/span/db_sql.md b/crates/weaver_forge/expected_output/test/span/db_sql.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_sql.md rename to crates/weaver_forge/expected_output/test/span/db_sql.md diff --git a/crates/weaver_forge/expected_output/span/db_tech.md b/crates/weaver_forge/expected_output/test/span/db_tech.md similarity index 100% rename from crates/weaver_forge/expected_output/span/db_tech.md rename to crates/weaver_forge/expected_output/test/span/db_tech.md diff --git a/crates/weaver_forge/expected_output/spans.md b/crates/weaver_forge/expected_output/test/spans.md similarity index 100% rename from crates/weaver_forge/expected_output/spans.md rename to crates/weaver_forge/expected_output/test/spans.md diff --git a/crates/weaver_forge/whitespace_control_templates/test/expected_output/registry.md b/crates/weaver_forge/expected_output/whitespace_control/registry.md similarity index 100% rename from crates/weaver_forge/whitespace_control_templates/test/expected_output/registry.md rename to crates/weaver_forge/expected_output/whitespace_control/registry.md diff --git a/crates/weaver_forge/src/lib.rs b/crates/weaver_forge/src/lib.rs index 77b8a051..e8278c53 100644 --- a/crates/weaver_forge/src/lib.rs +++ b/crates/weaver_forge/src/lib.rs @@ -448,6 +448,11 @@ impl TemplateEngine { error: e.to_string(), })?; + // Add minijinja contrib support + minijinja_contrib::add_to_environment(&mut env); + // Add minijinja py-compat support to improve compatibility with Python Jinja2 + env.set_unknown_method_callback(minijinja_contrib::pycompat::unknown_method_callback); + let file_loader = self.file_loader.clone(); env.set_loader(move |name| { file_loader @@ -506,6 +511,7 @@ mod tests { use std::path::Path; use globset::Glob; + use serde::Serialize; use weaver_common::TestLogger; use weaver_diff::diff_dir; @@ -679,7 +685,7 @@ mod tests { .generate( logger.clone(), &template_registry, - Path::new("observed_output"), + Path::new("observed_output/test"), &OutputDirective::File, ) .inspect_err(|e| { @@ -687,13 +693,13 @@ mod tests { }) .expect("Failed to generate registry assets"); - assert!(diff_dir("expected_output", "observed_output").unwrap()); + assert!(diff_dir("expected_output/test", "observed_output/test").unwrap()); } #[test] fn test_whitespace_control() { let logger = TestLogger::default(); - let loader = FileSystemFileLoader::try_new("whitespace_control_templates".into(), "test") + let loader = FileSystemFileLoader::try_new("templates".into(), "whitespace_control") .expect("Failed to create file system loader"); let engine = super::TemplateEngine::try_new(loader, Params::default()) .expect("Failed to create template engine"); @@ -719,7 +725,7 @@ mod tests { .generate( logger.clone(), &template_registry, - Path::new("whitespace_control_templates/test/observed_output"), + Path::new("observed_output/whitespace_control"), &OutputDirective::File, ) .inspect_err(|e| { @@ -728,9 +734,40 @@ mod tests { .expect("Failed to generate registry assets"); assert!(diff_dir( - "whitespace_control_templates/test/expected_output", - "whitespace_control_templates/test/observed_output" + "expected_output/whitespace_control", + "observed_output/whitespace_control" ) .unwrap()); } + + #[test] + fn test_py_compat() { + #[derive(Serialize)] + struct Context { + text: String, + } + + let logger = TestLogger::default(); + let loader = FileSystemFileLoader::try_new("templates".into(), "py_compat") + .expect("Failed to create file system loader"); + let engine = super::TemplateEngine::try_new(loader, Params::default()) + .expect("Failed to create template engine"); + let context = Context { + text: "Hello, World!".to_owned(), + }; + + engine + .generate( + logger.clone(), + &context, + Path::new("observed_output/py_compat"), + &OutputDirective::File, + ) + .inspect_err(|e| { + print_dedup_errors(logger.clone(), e.clone()); + }) + .expect("Failed to generate registry assets"); + + assert!(diff_dir("expected_output/py_compat", "observed_output/py_compat").unwrap()); + } } diff --git a/crates/weaver_forge/templates/py_compat/test b/crates/weaver_forge/templates/py_compat/test new file mode 100644 index 00000000..40d6e7ef --- /dev/null +++ b/crates/weaver_forge/templates/py_compat/test @@ -0,0 +1,6 @@ +Test integration with `py_compat` functions + +"{{ctx.text}}".startswith("Hello") => {{ ctx.text.startswith("Hello") }} +"{{ctx.text}}".startswith("Bonjour") => {{ ctx.text.startswith("Bonjour") }} +"{{ctx.text}}".endswith("World!") => {{ ctx.text.endswith("World!") }} +"{{ctx.text}}".endswith("Monde!") => {{ ctx.text.endswith("Monde!") }} \ No newline at end of file diff --git a/crates/weaver_forge/templates/py_compat/weaver.yaml b/crates/weaver_forge/templates/py_compat/weaver.yaml new file mode 100644 index 00000000..d599c338 --- /dev/null +++ b/crates/weaver_forge/templates/py_compat/weaver.yaml @@ -0,0 +1,4 @@ +templates: + - pattern: test + filter: . + application_mode: single \ No newline at end of file diff --git a/crates/weaver_forge/whitespace_control_templates/test/registry.md b/crates/weaver_forge/templates/whitespace_control/registry.md similarity index 100% rename from crates/weaver_forge/whitespace_control_templates/test/registry.md rename to crates/weaver_forge/templates/whitespace_control/registry.md diff --git a/crates/weaver_forge/whitespace_control_templates/test/weaver.yaml b/crates/weaver_forge/templates/whitespace_control/weaver.yaml similarity index 100% rename from crates/weaver_forge/whitespace_control_templates/test/weaver.yaml rename to crates/weaver_forge/templates/whitespace_control/weaver.yaml