Skip to content

Commit

Permalink
Feat/tinygo codegen (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelr authored May 25, 2022
1 parent 855cb35 commit 78f309b
Show file tree
Hide file tree
Showing 15 changed files with 389 additions and 228 deletions.
7 changes: 4 additions & 3 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ edition = "2021"
max_width = 100
reorder_imports = true
chain_width = 75
imports_granularity = "Crate"
overflow_delimited_expr = true
single_line_if_else_max_width = 70
group_imports = "StdExternalCrate"
struct_lit_width = 40
struct_variant_width = 55
# these require rust-nightly
#overflow_delimited_expr = true
#imports_granularity = "Crate"
#group_imports = "StdExternalCrate"
#unstable_fetures = false
12 changes: 12 additions & 0 deletions codegen/.rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
edition = "2021"
max_width = 100
reorder_imports = true
chain_width = 75
single_line_if_else_max_width = 70
struct_lit_width = 40
struct_variant_width = 55
# these require rust-nightly
#overflow_delimited_expr = true
#imports_granularity = "Crate"
#group_imports = "StdExternalCrate"
#unstable_fetures = false
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "weld-codegen"
version = "0.4.4"
version = "0.4.5"
edition = "2021"
authors = [ "wasmcloud Team" ]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion codegen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ test::

rust-check::
cargo clippy --all-features --all-targets
rustfmt --edition 2021 --check src/*.rs
rustfmt --edition 2021 --check src/*.rs bin/*.rs

.PHONY: all build release clean lint validate test update rust-check
4 changes: 1 addition & 3 deletions codegen/bin/dump-smithy-model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ struct Args {

fn main() -> Result<()> {
let args = Args::parse();
let config_path = args
.config
.unwrap_or_else(|| PathBuf::from("./codegen.toml"));
let config_path = args.config.unwrap_or_else(|| PathBuf::from("./codegen.toml"));
if !config_path.is_file() {
return Err(anyhow!("missing config file {}", &config_path.display()));
}
Expand Down
1 change: 1 addition & 0 deletions codegen/codegen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace = "org.wasmcloud.model"
no_serde = true # don't generate proto serialization & deserialization for this model

[tinygo]
formatter = [ "goimports", "-w" ]
output_dir = "../../interfaces/core"
files = [
{ path = "tinygo/core.go", package="actor", namespace = "org.wasmcloud.core" },
Expand Down
Loading

0 comments on commit 78f309b

Please sign in to comment.