formatter is much cleaner

This commit is contained in:
Benton Edmondson 2022-06-07 23:50:34 -04:00
parent 1c2b071fd9
commit 4948e52110
2 changed files with 7 additions and 22 deletions

View file

@ -181,24 +181,11 @@
chmod +x $out/bin/tests chmod +x $out/bin/tests
''; '';
}; };
devShell.x86_64-linux = nixpkgs.mkShell { packages.x86_64-linux.formatter = nixpkgs.writeShellScriptBin "formatter" ''
packages = [ set -x
# nix formatter ${nixpkgs-dyn.clang-tools}/bin/clang-format -i --verbose ./src/*.cpp
nixpkgs-dyn.nixpkgs-fmt ${nixpkgs-dyn.nixpkgs-fmt}/bin/nixpkgs-fmt .
# python formatter ${nixpkgs-dyn.black}/bin/black ./tests
nixpkgs-dyn.black '';
# cpp formatter
nixpkgs-dyn.clang-tools
];
shellHook = ''
fmt () {
set -ex
nixpkgs-fmt .
black ./tests
clang-format -i --verbose src/*.cpp
set +ex
}
'';
};
}; };
} }

View file

@ -47,9 +47,7 @@ Test books can be found [here](https://www.adobe.com/solutions/ebook/digital-edi
### Formatting ### Formatting
``` ```
nix develop nix run .#formatter
fmt
exit
``` ```
## The Name ## The Name