ty: add module

This commit is contained in:
Mirko Lenz 2025-12-06 09:51:31 +01:00 committed by Austin Horstman
parent f9d45d664e
commit 6bdf2a68e1
5 changed files with 107 additions and 0 deletions

View file

@ -0,0 +1,4 @@
{
ty-example-settings = ./example-settings.nix;
ty-no-settings = ./no-settings.nix;
}

View file

@ -0,0 +1,25 @@
{ pkgs, ... }:
{
programs.ty = {
enable = true;
settings = {
rules.index-out-of-bounds = "ignore";
};
};
test.stubs.ty = { };
nmt.script =
let
expectedConfigPath = "home-files/.config/ty/ty.toml";
expectedConfigContent = pkgs.writeText "ty.config-custom.expected" ''
[rules]
index-out-of-bounds = "ignore"
'';
in
''
assertFileExists "${expectedConfigPath}"
assertFileContent "${expectedConfigPath}" "${expectedConfigContent}"
'';
}

View file

@ -0,0 +1,17 @@
{ pkgs, ... }:
{
programs.ty = {
enable = true;
};
test.stubs.ty = { };
nmt.script =
let
expectedConfigPath = "home-files/.config/ty/ty.toml";
in
''
assertPathNotExists "${expectedConfigPath}"
'';
}