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
'';
};
devShell.x86_64-linux = nixpkgs.mkShell {
packages = [
# nix formatter
nixpkgs-dyn.nixpkgs-fmt
# python formatter
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
}
packages.x86_64-linux.formatter = nixpkgs.writeShellScriptBin "formatter" ''
set -x
${nixpkgs-dyn.clang-tools}/bin/clang-format -i --verbose ./src/*.cpp
${nixpkgs-dyn.nixpkgs-fmt}/bin/nixpkgs-fmt .
${nixpkgs-dyn.black}/bin/black ./tests
'';
};
};
}

View file

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