From 979e46e6f6c98e3fe57cfa719db93bc2ff3348da Mon Sep 17 00:00:00 2001 From: Lewis Date: Wed, 27 May 2026 10:17:44 +0000 Subject: [PATCH] housekeeping: pre-work for rust projects Lewis: May this revision serve well! --- .dockerignore | 1 + .editorconfig | 4 ++++ .gitignore | 2 ++ Cargo.toml | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 6 ++++++ rust-toolchain.toml | 5 +++++ 6 file(s) changed, 60 insertion(s)(+), 0 deletion(s)(-) diff --git a/.dockerignore b/.dockerignore --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,7 @@ sites/target sites/.wrangler +target result result-* diff --git a/.editorconfig b/.editorconfig --- a/.editorconfig +++ b/.editorconfig @@ -14,3 +14,7 @@ [*.yml] indent_size = 2 + +[*.rs] +indent_style = space +indent_size = 4 diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ **/*.bleve sites/target/ sites/.wrangler/ +/target +**/src/_lex/ # Created if following hacking.md genjwks.out /nix/vm-data diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,42 @@ +[workspace] +resolver = "2" +members = [] +exclude = ["sites"] + +[workspace.package] +edition = "2024" +rust-version = "1.95" +license = "MIT" +authors = [ + "Lewis ", + "Seongmin Lee ", + "oppiliappan ", + "Anirudh Oppiliappan ", + "eti ", +] + +[workspace.lints.rust] +unsafe_code = "forbid" +unused_must_use = "deny" + +[workspace.lints.clippy] +dbg_macro = "warn" +todo = "warn" +print_stdout = "deny" +print_stderr = "warn" + +[profile.release] +lto = "fat" +strip = true +codegen-units = 1 +panic = "abort" + +[profile.bench] +debug = 1 +strip = false + +[profile.profiling] +inherits = "release" +debug = 1 +strip = false +lto = "thin" diff --git a/flake.nix b/flake.nix --- a/flake.nix +++ b/flake.nix @@ -164,6 +164,12 @@ includes = ["*.go"]; }; + rustfmt = { + command = pkgs.lib.getExe' fenix.packages.${system}.stable.rustfmt "rustfmt"; + options = ["--edition" "2024"]; + includes = ["*.rs"]; + }; + # prettier = let # wrapper = pkgs.runCommandLocal "prettier-wrapper" {nativeBuildInputs = [pkgs.makeWrapper];} '' # makeWrapper ${pkgs.prettier}/bin/prettier "$out" --add-flags "--plugin=${pkgs.prettier-plugin-go-template}/lib/node_modules/prettier-plugin-go-template/lib/index.js" diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.95.0" +components = ["rustfmt", "clippy"] +targets = ["wasm32-unknown-unknown"] +profile = "minimal" -- tangled.sh