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 /modules/programs/pubs.nix @loicreynier
/tests/modules/programs/pubs @loicreynier /tests/modules/programs/pubs @loicreynier
/modules/programs/pylint.nix @florpe
/modules/programs/rbw.nix @ambroisie /modules/programs/rbw.nix @ambroisie
/tests/modules/programs/rbw @ambroisie /tests/modules/programs/rbw @ambroisie

View file

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

View file

@ -131,6 +131,7 @@ let
./programs/piston-cli.nix ./programs/piston-cli.nix
./programs/powerline-go.nix ./programs/powerline-go.nix
./programs/pubs.nix ./programs/pubs.nix
./programs/pylint.nix
./programs/qutebrowser.nix ./programs/qutebrowser.nix
./programs/rbw.nix ./programs/rbw.nix
./programs/readline.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;
};
}