1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-14 04:51:08 +01:00

mypy: init module (#7656)

This commit is contained in:
chillcicada 2025-08-17 22:46:27 +08:00 committed by GitHub
parent 3dcae8af51
commit bc01493178
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,47 @@
{ pkgs, ... }:
{
programs.mypy = {
enable = true;
package = pkgs.mypy;
settings = {
mypy = {
warn_return_any = true;
warn_unused_configs = true;
};
"mypy-mycode.foo.*" = {
disallow_untyped_defs = true;
};
"mypy-mycode.bar".warn_return_any = false;
"mypy-somelibrary".ignore_missing_imports = true;
};
};
nmt.script =
let
configFile = "home-files/.config/mypy/config";
in
''
assertFileExists ${configFile}
assertFileContent ${configFile} \
${pkgs.writeText "settings-expected" ''
[mypy]
warn_return_any=true
warn_unused_configs=true
[mypy-mycode.bar]
warn_return_any=false
[mypy-mycode.foo.*]
disallow_untyped_defs=true
[mypy-somelibrary]
ignore_missing_imports=true
''}
'';
}

View file

@ -0,0 +1,3 @@
{
mypy-basic-config = ./basic-config.nix;
}