diff --git a/shell.nix b/shell.nix index 159cd42..d920a6f 100644 --- a/shell.nix +++ b/shell.nix @@ -27,6 +27,7 @@ in nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.treefmt + pkgs.llvmPackages.clang # clang-format pkgs.nixpkgs-fmt (pkgs.python3.withPackages (ps: [ diff --git a/treefmt.toml b/treefmt.toml index 8309d20..aacc3bb 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -1,3 +1,8 @@ +[formatter."c++"] +command = "clang-format" +options = [ "-i", "-style", "{BasedOnStyle: llvm, IndentWidth: 4, SortIncludes: false}" ] +includes = [ "*.c", "*.cpp", "*.cc", "*.h", "*.hpp" ] + [formatter.nix] command = "nixpkgs-fmt" includes = ["*.nix"]