added formatter + reformat existing codebase (#175)

This commit is contained in:
Gaétan Lepage 2023-02-20 11:42:13 +01:00 committed by GitHub
parent 0bf4313f22
commit 264de8cefb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 3727 additions and 3341 deletions

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.gitgutter;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.gitgutter;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.gitgutter = {
enable = mkEnableOption "gitgutter";
@ -54,14 +57,14 @@ in
};
signs = mkOption {
type =
let
signOption = desc: mkOption {
type = let
signOption = desc:
mkOption {
type = types.nullOr types.str;
default = null;
description = "Sign for ${desc}";
};
in
in
types.submodule {
options = {
added = signOption "added lines";
@ -73,7 +76,7 @@ in
modifiedRemoved = signOption "modified and removed lines";
};
};
default = { };
default = {};
description = "Custom signs for the sign column";
};
@ -166,20 +169,25 @@ in
};
};
config =
let
grepPackage = if builtins.isAttrs cfg.grep then [ cfg.grep.package ] else [ ];
grepCommand = if builtins.isAttrs cfg.grep then cfg.grep.command else cfg.grep;
in
config = let
grepPackage =
if builtins.isAttrs cfg.grep
then [cfg.grep.package]
else [];
grepCommand =
if builtins.isAttrs cfg.grep
then cfg.grep.command
else cfg.grep;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
options = mkIf cfg.recommendedSettings {
updatetime = 100;
foldtext = "gitgutter#fold#foldtext";
};
extraPackages = [ pkgs.git ] ++ grepPackage;
extraPackages = [pkgs.git] ++ grepPackage;
globals = {
gitgutter_max_signs = mkIf (!isNull cfg.maxSigns) cfg.maxSigns;