From 0be49e8295221cbcfe24394d73734986d96b86bc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 25 Feb 2023 19:26:52 +0800 Subject: [PATCH] Add formatter for codebase --- flake.nix | 1 + treefmt.toml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 treefmt.toml diff --git a/flake.nix b/flake.nix index 2d1287c..4b40510 100644 --- a/flake.nix +++ b/flake.nix @@ -24,5 +24,6 @@ in { devShells.default = import ./shell.nix { inherit pkgs; }; + formatter = pkgs.treefmt; }); } diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..137caa5 --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,24 @@ +[formatter.nix] +command = "nixpkgs-fmt" +includes = ["*.nix"] + +[formatter.ruby] +command = "rufo" +options = ["-x"] +includes = ["*.rb"] + +[formatter.web] +command = "prettier" +options = ["--write"] +includes = [ + "*.css", + "*.html", + "*.js", + "*.json", + "*.jsx", + "*.md", + "*.mdx", + "*.scss", + "*.ts", + "*.yaml", +]