Files
brianmcgee 444f0fd68e
buildbot/nix-eval Build done.
PR Size Review Check / pr-size-review-gate (pull_request) Successful in 38s
buildbot/nix-build Build done.
gitea-mq/buildbot/nix-eval Build done.
gitea-mq/buildbot/nix-build Build done.
gitea-mq Merge queue passed
sizelint / sizelint (pull_request) Successful in 2m44s
docs: revert mdformat damage to MkDocs markdown
mdformat does not understand MkDocs Material extensions such as
admonitions (!!!), content tabs (===), or YAML frontmatter (---).
The recent switch from prettier to mdformat mangled them in some docs files.

Restore the affected files to their pre-mdformat state and exclude
docs/**/*.md from mdformat in the formatter configuration.
2026-04-14 10:48:12 +01:00

93 lines
1.9 KiB
Nix

{
inputs,
...
}:
{
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = {
treefmt = {
projectRootFile = ".git/config";
programs = {
nixfmt.enable = true;
deadnix.enable = true;
gofumpt.enable = true;
mdformat = {
enable = true;
plugins = ps: [ ps.mdformat-gfm ];
settings = {
number = true;
wrap = 80;
};
excludes = [
"docs/**/*.md"
];
};
prettier = {
enable = true;
excludes = [
"*.md"
"*.mdx"
];
};
rustfmt.enable = true;
shellcheck.enable = true;
shfmt.enable = true;
sizelint =
let
sizelintExcludes = [ ];
in
{
enable = true;
settings = {
excludes = sizelintExcludes;
max_file_size = "100kb";
rules.default.description = "File exceeds the maximum allowed size";
rules.default.suggestion = "Add the file to 'sizelintExcludes' in nix/formatter.nix";
};
};
statix.enable = true;
};
settings = {
global.excludes = [
"LICENSE"
".adr-dir"
# unsupported extensions
"*.{gif,png,svg,tape,mts,lock,mod,sum,toml,env,envrc,gitignore,sql,conf,pem,*.so.2,key,pub,py,narHash}"
"data-mesher/test/networks/*"
"nss-datamesher/test/dns.json"
];
formatter = {
deadnix = {
priority = 1;
};
statix = {
priority = 2;
};
nixfmt = {
priority = 3;
};
prettier = {
options = [
"--tab-width"
"4"
];
};
};
};
};
};
}