Add clang-format

This commit is contained in:
adisbladis 2022-04-26 21:04:54 +12:00
parent 76f68a8605
commit 8b8f456765
2 changed files with 6 additions and 0 deletions

View file

@ -27,6 +27,7 @@ in
nativeBuildInputs = old.nativeBuildInputs ++ [
pkgs.treefmt
pkgs.llvmPackages.clang # clang-format
pkgs.nixpkgs-fmt
(pkgs.python3.withPackages (ps: [

View file

@ -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"]