mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
feat: add treefmt
This commit is contained in:
Generated
+22
-1
@@ -125,7 +125,8 @@
|
|||||||
"fenix": "fenix",
|
"fenix": "fenix",
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-analyzer-src": {
|
"rust-analyzer-src": {
|
||||||
@@ -144,6 +145,26 @@
|
|||||||
"repo": "rust-analyzer",
|
"repo": "rust-analyzer",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1760120816,
|
||||||
|
"narHash": "sha256-gq9rdocpmRZCwLS5vsHozwB6b5nrOBDNc2kkEaTXHfg=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "761ae7aff00907b607125b2f57338b74177697ed",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
treefmt-nix = {
|
||||||
|
url = "github:numtide/treefmt-nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# for default.nix
|
# for default.nix
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
url = "github:edolstra/flake-compat?ref=master";
|
url = "github:edolstra/flake-compat?ref=master";
|
||||||
|
|||||||
@@ -6,5 +6,6 @@
|
|||||||
./tests
|
./tests
|
||||||
|
|
||||||
./hydra.nix
|
./hydra.nix
|
||||||
|
./fmt.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
# load the flake module from upstream
|
||||||
|
imports = [ inputs.treefmt-nix.flakeModule ];
|
||||||
|
|
||||||
|
perSystem =
|
||||||
|
{ self', lib, ... }:
|
||||||
|
{
|
||||||
|
treefmt = {
|
||||||
|
# repo root as project root
|
||||||
|
projectRoot = inputs.self;
|
||||||
|
|
||||||
|
# the formatters
|
||||||
|
programs = {
|
||||||
|
nixfmt.enable = true;
|
||||||
|
typos = {
|
||||||
|
enable = true;
|
||||||
|
configFile = "${inputs.self}/.typos.toml";
|
||||||
|
};
|
||||||
|
taplo = {
|
||||||
|
enable = true;
|
||||||
|
settings = lib.importTOML "${inputs.self}/taplo.toml";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
settings.formatter.rustfmt = {
|
||||||
|
command = "${lib.getExe' self'.packages.dev-toolchain "rustfmt"}";
|
||||||
|
includes = [ "**/*.rs" ];
|
||||||
|
options = [
|
||||||
|
"--unstable-features"
|
||||||
|
"--edition=2024"
|
||||||
|
"--config-path=${inputs.self}/rustfmt.toml"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[formatting]
|
||||||
|
align_entries = true # Align entries vertically. Entries that have table headers, comments, or blank lines between them are not aligned.
|
||||||
|
|
||||||
|
reorder_arrays = true # Alphabetically reorder array values that are not separated by blank lines.
|
||||||
|
reorder_inline_tables = true # Alphabetically reorder inline tables.
|
||||||
|
reorder_keys = true # Alphabetically reorder keys that are not separated by blank lines.
|
||||||
Reference in New Issue
Block a user