From 2700d47c011ca3befeb6cab684930992617b5454 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sat, 28 Dec 2024 23:28:46 -0800 Subject: [PATCH] chore: add treefmt --- flake.nix | 9 ++++++++- treefmt.toml | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 treefmt.toml diff --git a/flake.nix b/flake.nix index 5cd6c9e..a897a4f 100644 --- a/flake.nix +++ b/flake.nix @@ -237,10 +237,17 @@ devShells = { default = pkgs.mkShell { name = defaultPackageName; - packages = [ defaultPackage ] ++ (with pkgs; [ lua-language-server ]); + packages = + [ defaultPackage ] + ++ (with pkgs; [ + lua-language-server + nixfmt-rfc-style + stylua + ]); }; }; + formatter = pkgs.treefmt; } ) // { diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..1972a46 --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,13 @@ +excludes = ["flake.lock", ".gitignore", "README.md"] + +[formatter.stylua] +command = "stylua" +excludes = [] +includes = ["*.lua"] +options = [] + +[formatter.nixfmt-rfc-style] +command = "nixfmt" +excludes = [] +includes = ["*.nix"] +options = []