mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
switch to treefmt module
This commit is contained in:
parent
319912f5f2
commit
c70834ccb9
4 changed files with 66 additions and 48 deletions
|
|
@ -59,7 +59,8 @@ details {
|
|||
width: calc(100% - 1px);
|
||||
}
|
||||
|
||||
table, tbody {
|
||||
table,
|
||||
tbody {
|
||||
// fill entire width
|
||||
margin: 0 !important;
|
||||
|
||||
|
|
|
|||
37
flake.lock
generated
37
flake.lock
generated
|
|
@ -50,11 +50,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1680945546,
|
||||
"narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d9f759f2ea8d265d974a6e1259bd510ac5844c5d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"treefmt": "treefmt"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
|
|
@ -71,6 +88,24 @@
|
|||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688026376,
|
||||
"narHash": "sha256-qJmkr9BWDpqblk4E9/rCsAEl39y2n4Ycw6KRopvpUcY=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "df3f32b0cc253dfc7009b7317e8f0e7ccd70b1cf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
|
|||
28
flake.nix
28
flake.nix
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
treefmt.url = "github:numtide/treefmt-nix";
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
@ -63,14 +64,6 @@
|
|||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
# formatters
|
||||
alejandra
|
||||
black
|
||||
nodePackages.prettier
|
||||
nodePackages.prettier-plugin-toml
|
||||
shfmt
|
||||
treefmt
|
||||
|
||||
# extra tools
|
||||
dive
|
||||
fd
|
||||
|
|
@ -91,7 +84,24 @@
|
|||
'';
|
||||
};
|
||||
|
||||
formatter = pkgs.treefmt;
|
||||
formatter =
|
||||
(inputs.treefmt.lib.evalModule pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
black.enable = true;
|
||||
prettier.enable = true;
|
||||
shfmt.enable = true;
|
||||
};
|
||||
settings.global.excludes = [
|
||||
"docs/themes/*"
|
||||
"docs/layouts/*"
|
||||
"modules/generated/*"
|
||||
];
|
||||
})
|
||||
.config
|
||||
.build
|
||||
.wrapper;
|
||||
|
||||
apps = {
|
||||
docs = inputs.flake-utils.lib.mkApp {
|
||||
|
|
|
|||
28
treefmt.toml
28
treefmt.toml
|
|
@ -1,28 +0,0 @@
|
|||
[global]
|
||||
excludes = ["./docs/themes/*"]
|
||||
|
||||
[formatter.nix]
|
||||
command = "alejandra"
|
||||
includes = ["*.nix"]
|
||||
excludes = ["./modules/generated/*"]
|
||||
|
||||
[formatter.prettier]
|
||||
command = "prettier"
|
||||
options = ["--plugin", "prettier-plugin-toml", "--write"]
|
||||
includes = ["*.md", "*.yaml", "*.toml", "*.json"]
|
||||
excludes = []
|
||||
|
||||
[formatter.black]
|
||||
command = "black"
|
||||
includes = ["*.py"]
|
||||
|
||||
[formatter.shell]
|
||||
command = "shfmt"
|
||||
options = [
|
||||
"-i",
|
||||
"2", # indent 2
|
||||
"-s", # simplify the code
|
||||
"-w", # write back to the file
|
||||
|
||||
]
|
||||
includes = ["*.sh", "*.bash"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue