Skip to content

Commit

Permalink
Fixes from review.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuereth committed Jul 17, 2024
2 parents f625068 + ece8753 commit 6834934
Show file tree
Hide file tree
Showing 90 changed files with 137 additions and 72 deletions.
106 changes: 52 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ 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"
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"] }
Expand Down Expand Up @@ -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"] }
rayon = "1.10.0"
ratatui = { version = "0.26.3", features=["serde"] }
crossterm = { version = "0.27.0", features = ["serde"] }
Expand Down Expand Up @@ -186,7 +186,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"
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions crates/weaver_forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ 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.2.1"
jaq-std = "1.5.1"
jaq-interpret = "1.2.1"
jaq-parse = "1.0.2"
indexmap = "2.2.6"
Expand Down
5 changes: 2 additions & 3 deletions crates/weaver_forge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
Expand Down Expand Up @@ -131,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.
Expand Down
6 changes: 6 additions & 0 deletions crates/weaver_forge/expected_output/py_compat/test
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 6834934

Please sign in to comment.