pylint: add module (#2729)

This commit is contained in:
florpe 2022-04-11 03:54:04 +02:00 committed by GitHub
parent f911ebbec9
commit e39a9d0103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -210,6 +210,8 @@
/modules/programs/pubs.nix @loicreynier
/tests/modules/programs/pubs @loicreynier
/modules/programs/pylint.nix @florpe
/modules/programs/rbw.nix @ambroisie
/tests/modules/programs/rbw @ambroisie

View File

@ -123,6 +123,12 @@
githubId = 46252070;
name = "Sara Johnsson";
};
florpe = {
email = "jens.krewald@gmail.com";
github = "florpe";
githubId = 53856373;
name = "Jens Krewald";
};
maximsmol = {
email = "maximsmol@gmail.com";
github = "maximsmol";

View File

@ -131,6 +131,7 @@ let
./programs/piston-cli.nix
./programs/powerline-go.nix
./programs/pubs.nix
./programs/pylint.nix
./programs/qutebrowser.nix
./programs/rbw.nix
./programs/readline.nix

View File

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.pylint;
listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
iniFormat = pkgs.formats.ini { inherit listToValue; };
in {
meta.maintainers = [ hm.maintainers.florpe ];
options.programs.pylint = {
enable = mkEnableOption "the pylint Python linter";
package = mkOption {
type = types.package;
default = pkgs.python3Packages.pylint;
defaultText = literalExpression "pkgs.python3Packages.pylint";
description = "The pylint package to use.";
};
settings = mkOption {
type = iniFormat.type;
default = { };
defaultText = literalExpression "{}";
description = "The pylint configuration.";
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.file.".pylintrc".source = iniFormat.generate "pylintrc" cfg.settings;
};
}