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:
parent
3dcae8af51
commit
bc01493178
3 changed files with 100 additions and 0 deletions
47
tests/modules/programs/mypy/basic-config.nix
Normal file
47
tests/modules/programs/mypy/basic-config.nix
Normal 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
|
||||
''}
|
||||
'';
|
||||
}
|
||||
3
tests/modules/programs/mypy/default.nix
Normal file
3
tests/modules/programs/mypy/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
mypy-basic-config = ./basic-config.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue