treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -4,9 +4,11 @@
config,
...
}:
with lib; let
with lib;
let
cfg = config.plugins.cmp-git;
in {
in
{
options.plugins.cmp-git.settings = helpers.neovim-plugin.mkSettingsOption {
pluginName = "cmp_git";
options = {
@ -30,13 +32,13 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').git.commits";}''
"Function used to sort the commits.";
''{__raw = "require('cmp_git.sort').git.commits";}''
"Function used to sort the commits.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').git.commits";}''
"Function used to format the commits.";
''{__raw = "require('cmp_git.format').git.commits";}''
"Function used to format the commits.";
};
};
@ -47,9 +49,8 @@ in {
issues = {
fields =
helpers.defaultNullOpts.mkListOf types.str
''["title" "number" "body" "updatedAt" "state"]''
"The fields used for issues.";
helpers.defaultNullOpts.mkListOf types.str ''["title" "number" "body" "updatedAt" "state"]''
"The fields used for issues.";
filter = helpers.defaultNullOpts.mkStr "all" ''
The filter to use when fetching issues.
@ -65,13 +66,13 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').github.issues";}''
"Function used to sort the issues.";
''{__raw = "require('cmp_git.sort').github.issues";}''
"Function used to sort the issues.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').github.issues";}''
"Function used to format the issues.";
''{__raw = "require('cmp_git.format').github.issues";}''
"Function used to format the issues.";
};
mentions = {
@ -81,20 +82,19 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').github.mentions";}''
"Function used to sort the mentions.";
''{__raw = "require('cmp_git.sort').github.mentions";}''
"Function used to sort the mentions.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').github.mentions";}''
"Function used to format the mentions.";
''{__raw = "require('cmp_git.format').github.mentions";}''
"Function used to format the mentions.";
};
pull_requests = {
fields =
helpers.defaultNullOpts.mkListOf types.str
''["title" "number" "body" "updatedAt" "state"]''
"The fields used for pull requests.";
helpers.defaultNullOpts.mkListOf types.str ''["title" "number" "body" "updatedAt" "state"]''
"The fields used for pull requests.";
limit = helpers.defaultNullOpts.mkUnsignedInt 100 ''
Max number of pull requests to fetch.
@ -106,13 +106,13 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').github.pull_requests";}''
"Function used to sort the pull requests.";
''{__raw = "require('cmp_git.sort').github.pull_requests";}''
"Function used to sort the pull requests.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').github.pull_requests";}''
"Function used to format the pull requests.";
''{__raw = "require('cmp_git.format').github.pull_requests";}''
"Function used to format the pull requests.";
};
};
@ -132,13 +132,13 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').gitlab.issues";}''
"Function used to sort the issues.";
''{__raw = "require('cmp_git.sort').gitlab.issues";}''
"Function used to sort the issues.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').gitlab.issues";}''
"Function used to format the issues.";
''{__raw = "require('cmp_git.format').gitlab.issues";}''
"Function used to format the issues.";
};
mentions = {
@ -148,13 +148,13 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').gitlab.mentions";}''
"Function used to sort the mentions.";
''{__raw = "require('cmp_git.sort').gitlab.mentions";}''
"Function used to sort the mentions.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').gitlab.mentions";}''
"Function used to format the mentions.";
''{__raw = "require('cmp_git.format').gitlab.mentions";}''
"Function used to format the mentions.";
};
merge_requests = {
@ -168,114 +168,118 @@ in {
sort_by =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.sort').gitlab.merge_requests";}''
"Function used to sort the merge requests.";
''{__raw = "require('cmp_git.sort').gitlab.merge_requests";}''
"Function used to sort the merge requests.";
format =
helpers.defaultNullOpts.mkNullable types.anything
''{__raw = "require('cmp_git.format').gitlab.merge_requests";}''
"Function used to format the merge requests.";
''{__raw = "require('cmp_git.format').gitlab.merge_requests";}''
"Function used to format the merge requests.";
};
};
trigger_actions =
helpers.defaultNullOpts.mkListOf
(types.submodule {
options = {
debug_name = helpers.mkNullOrStr "Debug name.";
(types.submodule {
options = {
debug_name = helpers.mkNullOrStr "Debug name.";
trigger_character = mkOption {
type = types.str;
example = ":";
description = ''
The trigger character.
Has to be a single character
'';
};
trigger_character = mkOption {
type = types.str;
example = ":";
description = ''
The trigger character.
Has to be a single character
'';
};
action = mkOption {
type = helpers.nixvimTypes.strLuaFn;
apply = helpers.mkRaw;
description = ''
The parameters to the action function are the different sources (currently `git`,
`gitlab` and `github`), the completion callback, the trigger character, the
parameters passed to complete from nvim-cmp, and the current git info.
'';
example = ''
function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end
'';
action = mkOption {
type = helpers.nixvimTypes.strLuaFn;
apply = helpers.mkRaw;
description = ''
The parameters to the action function are the different sources (currently `git`,
`gitlab` and `github`), the completion callback, the trigger character, the
parameters passed to complete from nvim-cmp, and the current git info.
'';
example = ''
function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end
'';
};
};
};
})
''
[
{
debug_name = "git_commits";
trigger_character = ":";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end
\'\';
}
{
debug_name = "gitlab_issues";
trigger_character = "#";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_issues(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "gitlab_mentions";
trigger_character = "@";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_mentions(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "gitlab_mrs";
trigger_character = "!";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_merge_requests(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "github_issues_and_pr";
trigger_character = "#";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.github:get_issues_and_prs(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "github_mentions";
trigger_character = "@";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.github:get_mentions(callback, git_info, trigger_char)
end
\'\';
}
]
''
''
If you want specific behaviour for a trigger or new behaviour for a trigger, you need to
add an entry in the `trigger_actions` list of the config.
The two necessary fields are the `trigger_character` and the `action`.
'';
})
''
[
{
debug_name = "git_commits";
trigger_character = ":";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end
\'\';
}
{
debug_name = "gitlab_issues";
trigger_character = "#";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_issues(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "gitlab_mentions";
trigger_character = "@";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_mentions(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "gitlab_mrs";
trigger_character = "!";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_merge_requests(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "github_issues_and_pr";
trigger_character = "#";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.github:get_issues_and_prs(callback, git_info, trigger_char)
end
\'\';
}
{
debug_name = "github_mentions";
trigger_character = "@";
action = \'\'
function(sources, trigger_char, callback, params, git_info)
return sources.github:get_mentions(callback, git_info, trigger_char)
end
\'\';
}
]
''
''
If you want specific behaviour for a trigger or new behaviour for a trigger, you need to
add an entry in the `trigger_actions` list of the config.
The two necessary fields are the `trigger_character` and the `action`.
'';
};
example = {
remotes = ["upstream" "origin" "foo"];
remotes = [
"upstream"
"origin"
"foo"
];
github.issues = {
filter = "all";
limit = 250;