|
680 | 680 | }; |
681 | 681 | }; |
682 | 682 | }; |
| 683 | + hledger-fmt = mkOption { |
| 684 | + description = "hledger-fmt hook"; |
| 685 | + type = types.submodule { |
| 686 | + imports = [ hookModule ]; |
| 687 | + options.settings = { |
| 688 | + fix = |
| 689 | + mkOption { |
| 690 | + type = types.bool; |
| 691 | + description = "Fix the files in place."; |
| 692 | + default = false; |
| 693 | + }; |
| 694 | + }; |
| 695 | + }; |
| 696 | + }; |
683 | 697 | hlint = mkOption { |
684 | 698 | description = "hlint hook"; |
685 | 699 | type = types.submodule { |
|
959 | 973 | }; |
960 | 974 | }; |
961 | 975 | nixfmt = mkOption { |
962 | | - description = "Deprecated nixfmt hook. Use nixfmt-classic or nixfmt-rfc-style instead."; |
| 976 | + description = "nixfmt hook"; |
963 | 977 | type = types.submodule { |
964 | 978 | imports = [ hookModule ]; |
965 | 979 | options.settings = { |
@@ -2154,10 +2168,19 @@ in |
2154 | 2168 | lib.optional cfg.hooks.rome.enable '' |
2155 | 2169 | The hook `hooks.rome` has been renamed to `hooks.biome`. |
2156 | 2170 | '' |
2157 | | - ++ lib.optional cfg.hooks.nixfmt.enable '' |
| 2171 | + ++ lib.optional (cfg.hooks.nixfmt.enable && lib.versionOlder cfg.hooks.nixfmt.package.version "1.0") '' |
2158 | 2172 | The hook `hooks.nixfmt` has been renamed to `hooks.nixfmt-classic`. |
2159 | 2173 |
|
2160 | 2174 | The new RFC 166-style nixfmt is available as `hooks.nixfmt-rfc-style`. |
| 2175 | + '' |
| 2176 | + ++ lib.optional (cfg.hooks.nixfmt-classic.enable && lib.versionAtLeast cfg.hooks.nixfmt-classic.package.version "1.0") '' |
| 2177 | + The hook `hooks.nixfmt-classic` is using an incompatible version of `nixfmt`. |
| 2178 | +
|
| 2179 | + Found: ${cfg.hooks.nixfmt-classic.package.version}. |
| 2180 | + Expected: < v1.0 |
| 2181 | +
|
| 2182 | + `hooks.nixfmt-classic` supports versions of `nixfmt` up to `v1.0`. |
| 2183 | + For `nixfmt` `v1.0` and newer, switch to `hooks.nixfmt`. |
2161 | 2184 | ''; |
2162 | 2185 |
|
2163 | 2186 | # PLEASE keep this sorted alphabetically. |
|
2222 | 2245 | in |
2223 | 2246 | "${hooks.ansible-lint.package}/bin/ansible-lint ${cmdArgs}"; |
2224 | 2247 | files = if hooks.ansible-lint.settings.subdir != "" then "${hooks.ansible-lint.settings.subdir}/" else ""; |
| 2248 | + pass_filenames = false; |
2225 | 2249 | }; |
2226 | 2250 | autoflake = |
2227 | 2251 | { |
@@ -2321,6 +2345,15 @@ in |
2321 | 2345 | files = "\\.rs$"; |
2322 | 2346 | pass_filenames = false; |
2323 | 2347 | }; |
| 2348 | + chart-testing = |
| 2349 | + { |
| 2350 | + name = "chart-testing"; |
| 2351 | + description = "CLI tool for linting and testing Helm charts"; |
| 2352 | + files = "^charts/"; |
| 2353 | + package = tools.chart-testing; |
| 2354 | + entry = "${hooks.chart-testing.package}/bin/ct lint --all --skip-helm-dependencies"; |
| 2355 | + pass_filenames = false; |
| 2356 | + }; |
2324 | 2357 | checkmake = { |
2325 | 2358 | name = "checkmake"; |
2326 | 2359 | description = "Experimental linter/analyzer for Makefiles"; |
@@ -2555,6 +2588,13 @@ in |
2555 | 2588 | entry = "${hooks.commitizen.package}/bin/cz check --allow-abort --commit-msg-file"; |
2556 | 2589 | stages = [ "commit-msg" ]; |
2557 | 2590 | }; |
| 2591 | + comrak = { |
| 2592 | + name = "comrak"; |
| 2593 | + description = "A 100% CommonMark-compatible GitHub Flavored Markdown formatter"; |
| 2594 | + package = tools.comrak; |
| 2595 | + entry = "${lib.getExe hooks.comrak.package} --inplace"; |
| 2596 | + types = [ "markdown" ]; |
| 2597 | + }; |
2558 | 2598 | conform = { |
2559 | 2599 | name = "conform enforce"; |
2560 | 2600 | description = "Policy enforcement for commits."; |
@@ -3086,6 +3126,22 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm |
3086 | 3126 | entry = "${hooks.hindent.package}/bin/hindent"; |
3087 | 3127 | files = "\\.l?hs(-boot)?$"; |
3088 | 3128 | }; |
| 3129 | + hledger-fmt = |
| 3130 | + { |
| 3131 | + name = "hledger-fmt"; |
| 3132 | + description = "Opinionated hledger's journal files formatter."; |
| 3133 | + package = tools.hledger-fmt; |
| 3134 | + entry = |
| 3135 | + let |
| 3136 | + cmdArgs = mkCmdArgs ( |
| 3137 | + with hooks.hledger-fmt.settings; [ |
| 3138 | + [ fix "--fix" ] |
| 3139 | + ] |
| 3140 | + ); |
| 3141 | + in |
| 3142 | + "${hooks.hledger-fmt.package}/bin/hledger-fmt ${cmdArgs}"; |
| 3143 | + files = "\\.(hledger|journal|j)$"; |
| 3144 | + }; |
3089 | 3145 | hlint = |
3090 | 3146 | { |
3091 | 3147 | name = "hlint"; |
@@ -3164,6 +3220,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm |
3164 | 3220 | end' |
3165 | 3221 | ''; |
3166 | 3222 | }; |
| 3223 | + keep-sorted = |
| 3224 | + { |
| 3225 | + name = "keep-sorted"; |
| 3226 | + description = "Language-agnostic formatter that sorts lines between two markers in a larger file."; |
| 3227 | + types = [ "text" ]; |
| 3228 | + package = tools.keep-sorted; |
| 3229 | + entry = "${hooks.keep-sorted.package}/bin/keep-sorted"; |
| 3230 | + }; |
3167 | 3231 | latexindent = |
3168 | 3232 | { |
3169 | 3233 | name = "latexindent"; |
@@ -4161,7 +4225,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm |
4161 | 4225 | inherit (hooks.typos.settings) config exclude; |
4162 | 4226 | configFile = toml.generate "typos-config.toml" config; |
4163 | 4227 | excludeFlags = lib.concatStringsSep " " |
4164 | | - (lib.map (glob: "--exclude ${glob}") exclude); |
| 4228 | + (lib.map (glob: "--exclude '${glob}'") exclude); |
4165 | 4229 | cmdArgs = |
4166 | 4230 | mkCmdArgs |
4167 | 4231 | (with hooks.typos.settings; [ |
@@ -4310,7 +4374,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm |
4310 | 4374 | cmdArgs = |
4311 | 4375 | mkCmdArgs |
4312 | 4376 | (with hooks.yamllint.settings; [ |
4313 | | - # Priorize multiline configuration over serialized configuration and configuration file |
| 4377 | + # Prioritize multiline configuration over serialized configuration and configuration file |
4314 | 4378 | [ (configuration != "") "--config-file ${configFile}" ] |
4315 | 4379 | [ (configData != "" && configuration == "") "--config-data \"${configData}\"" ] |
4316 | 4380 | [ (configPath != "" && configData == "" && configuration == "" && preset == "default") "--config-file ${configPath}" ] |
|
0 commit comments