From d40b80a910336a8afcf52f426a0dceab8ff1cddb Mon Sep 17 00:00:00 2001 From: Reed Krantz Date: Sun, 7 Jun 2026 21:38:04 -0500 Subject: [PATCH] feat: add toml and markdown formatters --- rust-esp32-c6/template/.cargo/config.toml | 5 +++-- rust-esp32-c6/template/.rumdl.toml | 8 ++++++++ rust-esp32-c6/template/Cargo.toml | 18 +++++++++--------- rust-esp32-c6/template/rust-toolchain.toml | 2 +- rust/default.nix | 6 +++--- rust/template/.rumdl.toml | 8 ++++++++ rust/template/Cargo.toml | 1 - 7 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 rust-esp32-c6/template/.rumdl.toml create mode 100644 rust/template/.rumdl.toml diff --git a/rust-esp32-c6/template/.cargo/config.toml b/rust-esp32-c6/template/.cargo/config.toml index a367c5a..7cdf7f0 100644 --- a/rust-esp32-c6/template/.cargo/config.toml +++ b/rust-esp32-c6/template/.cargo/config.toml @@ -2,13 +2,14 @@ runner = "espflash flash --monitor --chip esp32c6 --log-format defmt" [env] -DEFMT_LOG="info" +DEFMT_LOG = "info" [build] rustflags = [ # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) # NOTE: May negatively impact performance of produced code - "-C", "force-frame-pointers", + "-C", + "force-frame-pointers", ] target = "riscv32imac-unknown-none-elf" diff --git a/rust-esp32-c6/template/.rumdl.toml b/rust-esp32-c6/template/.rumdl.toml new file mode 100644 index 0000000..caf5b29 --- /dev/null +++ b/rust-esp32-c6/template/.rumdl.toml @@ -0,0 +1,8 @@ +[global] +disable = [ + # line length limits + "MD013", +] + +[MD057] +absolute-links = "relative_to_roots" diff --git a/rust-esp32-c6/template/Cargo.toml b/rust-esp32-c6/template/Cargo.toml index 93cb716..45a3831 100644 --- a/rust-esp32-c6/template/Cargo.toml +++ b/rust-esp32-c6/template/Cargo.toml @@ -1,8 +1,8 @@ [package] -edition = "2024" -name = "rust-esp32-c6" +edition = "2024" +name = "rust-esp32-c6" rust-version = "1.88" -version = "0.1.0" +version = "0.1.0" [[bin]] name = "rust-esp32-c6" @@ -18,7 +18,7 @@ esp-rtos = { version = "0.3.0", features = [ "esp32c6", ] } -defmt = "1.0.1" +defmt = "1.0.1" esp-bootloader-esp-idf = { version = "0.5.0", features = ["defmt", "esp32c6"] } embassy-executor = { version = "0.10.0", features = ["defmt"] } @@ -32,7 +32,7 @@ esp-backtrace = { version = "0.19.0", features = [ esp-println = { version = "0.17.0", features = ["defmt-espflash", "esp32c6"] } critical-section = "1.2.0" -static_cell = "2.1.1" +static_cell = "2.1.1" # For fine tuning these settings, please refer to https://doc.rust-lang.org/cargo/reference/profiles.html @@ -42,7 +42,7 @@ static_cell = "2.1.1" opt-level = "s" [profile.release] -codegen-units = 1 # LLVM can perform better optimizations using a single thread -debug = 2 # prefer slower builds but better debugging experience -lto = 'fat' -opt-level = 's' +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 # prefer slower builds but better debugging experience +lto = 'fat' +opt-level = 's' diff --git a/rust-esp32-c6/template/rust-toolchain.toml b/rust-esp32-c6/template/rust-toolchain.toml index fc10d6a..3951889 100644 --- a/rust-esp32-c6/template/rust-toolchain.toml +++ b/rust-esp32-c6/template/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "stable" +channel = "stable" components = ["rust-src"] targets = ["riscv32imac-unknown-none-elf"] diff --git a/rust/default.nix b/rust/default.nix index 8cb5233..7388ed9 100644 --- a/rust/default.nix +++ b/rust/default.nix @@ -199,9 +199,9 @@ }; # Formatter for nix files, available through 'nix fmt' - treefmt = lib.mkIf cfg.formatter.enable { - programs.alejandra.enable = lib.mkIf cfg.formatter.nix true; - programs.rustfmt = lib.mkIf cfg.formatter.rust { + treefmt.programs = lib.mkIf cfg.formatter.enable { + alejandra.enable = lib.mkIf cfg.formatter.nix true; + rustfmt = lib.mkIf cfg.formatter.rust { enable = true; edition = manifest.edition; }; diff --git a/rust/template/.rumdl.toml b/rust/template/.rumdl.toml new file mode 100644 index 0000000..caf5b29 --- /dev/null +++ b/rust/template/.rumdl.toml @@ -0,0 +1,8 @@ +[global] +disable = [ + # line length limits + "MD013", +] + +[MD057] +absolute-links = "relative_to_roots" diff --git a/rust/template/Cargo.toml b/rust/template/Cargo.toml index 885c49d..8d4db29 100644 --- a/rust/template/Cargo.toml +++ b/rust/template/Cargo.toml @@ -15,4 +15,3 @@ tracing-subscriber = "*" clap = { version = "*", features = ["derive"] } figment = { version = "*", features = ["toml", "env", "json"] } -