|
2 | 2 | let |
3 | 3 | inherit (config) hooks tools settings; |
4 | 4 | cfg = config; |
5 | | - inherit (lib) flatten mapAttrs mapAttrsToList mkDefault mkOption mkRemovedOptionModule mkRenamedOptionModule types; |
| 5 | + inherit (lib) flatten mapAttrs mapAttrsToList mkDefault mkOption mkEnableOption mkRemovedOptionModule mkRenamedOptionModule types; |
6 | 6 |
|
7 | 7 | toml = pkgs.formats.toml { }; |
8 | 8 |
|
@@ -2003,6 +2003,40 @@ in |
2003 | 2003 | }; |
2004 | 2004 | }; |
2005 | 2005 | }; |
| 2006 | + woodpecker-cli-lint = mkOption { |
| 2007 | + description = "`woodpecker-cli lint` hook"; |
| 2008 | + type = types.submodule { |
| 2009 | + imports = [ hookModule ]; |
| 2010 | + options.settings = { |
| 2011 | + workflowPath = mkOption { |
| 2012 | + type = types.str; |
| 2013 | + description = '' |
| 2014 | + Path to the workflow config file/directory. If not set, the program |
| 2015 | + looks for `.woodpecker.ya?ml` file or `.woodpecker` directory. |
| 2016 | + ''; |
| 2017 | + default = ""; |
| 2018 | + example = ".woodpecker.yml"; |
| 2019 | + }; |
| 2020 | + strict = mkEnableOption "" // { |
| 2021 | + description = "Whether to treat warnings as errors."; |
| 2022 | + }; |
| 2023 | + pluginsPrivileged = mkOption { |
| 2024 | + type = types.commas; |
| 2025 | + description = "List of plugins, allowed to run in privileged mode"; |
| 2026 | + default = ""; |
| 2027 | + }; |
| 2028 | + pluginsTrustedClone = mkOption { |
| 2029 | + type = types.commas; |
| 2030 | + description = '' |
| 2031 | + List of plugins, that are trusted to handle Git credentials in cloning steps. |
| 2032 | + If not set, the program defaults to |
| 2033 | + "docker.io/woodpeckerci/plugin-git:2.6.3,docker.io/woodpeckerci/plugin-git,quay.io/woodpeckerci/plugin-git". |
| 2034 | + ''; |
| 2035 | + default = ""; |
| 2036 | + }; |
| 2037 | + }; |
| 2038 | + }; |
| 2039 | + }; |
2006 | 2040 | yamlfmt = mkOption { |
2007 | 2041 | description = "yamlfmt hook"; |
2008 | 2042 | type = types.submodule { |
@@ -4152,6 +4186,25 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm |
4152 | 4186 | "${hooks.vale.package}/bin/vale${cmdArgs} ${hooks.vale.settings.flags}"; |
4153 | 4187 | types = [ "text" ]; |
4154 | 4188 | }; |
| 4189 | + woodpecker-cli-lint = { |
| 4190 | + name = "woodpecker-cli-lint"; |
| 4191 | + description = "Command line client for the Woodpecker Continuous Integration server (lint only)."; |
| 4192 | + package = tools.woodpecker-cli; |
| 4193 | + entry = |
| 4194 | + let |
| 4195 | + cmdArgs = mkCmdArgs (with hooks.woodpecker-cli-lint.settings; [ |
| 4196 | + [ (workflowPath != "") workflowPath ] |
| 4197 | + # this check depends on the internet connection, without it |
| 4198 | + # the lint is lightning-fast |
| 4199 | + [ true "--disable-update-check" ] |
| 4200 | + [ strict "--strict" ] |
| 4201 | + [ (pluginsPrivileged != "") "--plugins-privileged=${pluginsPrivileged}" ] |
| 4202 | + [ (pluginsTrustedClone != "") "--plugins-trusted-clone=${pluginsTrustedClone}" ] |
| 4203 | + ]); |
| 4204 | + in |
| 4205 | + "${lib.getExe hooks.woodpecker-cli-lint.package} lint ${cmdArgs}"; |
| 4206 | + types = [ "file" "yaml" ]; |
| 4207 | + }; |
4155 | 4208 | yamlfmt = |
4156 | 4209 | { |
4157 | 4210 | name = "yamlfmt"; |
|
0 commit comments