-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathflake-module.nix
More file actions
47 lines (45 loc) · 1.56 KB
/
Copy pathflake-module.nix
File metadata and controls
47 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ inputs, ... }:
{
imports = [ inputs.treefmt-nix.flakeModule ];
perSystem =
{ pkgs, lib, ... }:
{
treefmt = {
projectRootFile = "LICENSE.md";
programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt-rfc-style.compiler;
programs.nixfmt.package = pkgs.nixfmt-rfc-style;
programs.shellcheck.enable = true;
programs.deno.enable = true;
programs.ruff.check = true;
programs.ruff.format = true;
settings.formatter.shellcheck.options = [
"-s"
"bash"
];
programs.mypy = {
enable = pkgs.stdenv.buildPlatform.isLinux;
package = pkgs.buildbot.python.pkgs.mypy;
directories."." = {
modules = [
"buildbot_nix"
];
extraPythonPackages = [
(pkgs.python3.pkgs.toPythonModule pkgs.buildbot)
pkgs.buildbot-worker
pkgs.python3.pkgs.twisted
pkgs.python3.pkgs.pydantic
pkgs.python3.pkgs.zope-interface
];
};
};
# the mypy module adds `./buildbot_nix/**/*.py` which does not appear to work
# furthermore, saying `directories.""` will lead to `/buildbot_nix/**/*.py` which
# is obviously incorrect...
settings.formatter."mypy-." = lib.mkIf pkgs.stdenv.buildPlatform.isLinux {
includes = [ "buildbot_nix/**/*.py" ];
};
settings.formatter.ruff-check.priority = 1;
settings.formatter.ruff-format.priority = 2;
};
};
}