mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 23:23:57 +02:00
feat: add fmt
nix package
```shell $ nix run .#fmt ``` does all the automatic formatting the CI checks for. Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
5f2fb2c42c
commit
ee7c4ee177
1 changed files with 28 additions and 0 deletions
28
packages/fmt/default.nix
Normal file
28
packages/fmt/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
# Copyright (c) 2024 Matter Labs
|
||||||
|
{ lib
|
||||||
|
, pkgs
|
||||||
|
, teepot
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "fmt-teepot";
|
||||||
|
|
||||||
|
runtimeInputs = with pkgs;
|
||||||
|
[ nixpkgs-fmt coreutils taplo ]
|
||||||
|
++ teepot.teepot.nativeBuildInputs;
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
# .nix
|
||||||
|
echo "* Formatting nix files"
|
||||||
|
nixpkgs-fmt .
|
||||||
|
|
||||||
|
# .toml
|
||||||
|
echo "* Formatting toml files"
|
||||||
|
taplo fmt
|
||||||
|
|
||||||
|
# .rs
|
||||||
|
echo "* Formatting rust files"
|
||||||
|
cargo fmt
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue