Skip to content

Commit b4e3560

Browse files
committed
feat(rumdl): Add support for rumdl
1 parent 50b9238 commit b4e3560

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

modules/hooks.nix

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,28 @@ in
817817
};
818818
};
819819
};
820+
rumdl = mkOption {
821+
description = "rumdl hook";
822+
type = types.submodule {
823+
imports = [ hookModule ];
824+
options.settings = {
825+
configuration =
826+
mkOption {
827+
type = types.attrs;
828+
description =
829+
"See https://github.com/rvben/rumdl?tab=readme-ov-file#configuration";
830+
default = { };
831+
example = {
832+
configuration = {
833+
MD013 = {
834+
line-length = 100;
835+
};
836+
};
837+
};
838+
};
839+
};
840+
};
841+
};
820842
mdl = mkOption {
821843
description = "mdl hook";
822844
type = types.submodule {
@@ -2185,7 +2207,7 @@ in
21852207

21862208
# PLEASE keep this sorted alphabetically.
21872209
config.hooks = mapAttrs (_: mapAttrs (_: mkDefault))
2188-
rec {
2210+
{
21892211
actionlint =
21902212
{
21912213
name = "actionlint";
@@ -3317,6 +3339,21 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
33173339
entry = "${hooks.markdownlint.package}/bin/markdownlint -c ${pkgs.writeText "markdownlint.json" (builtins.toJSON hooks.markdownlint.settings.configuration)}";
33183340
files = "\\.md$";
33193341
};
3342+
rumdl =
3343+
let
3344+
cmdArgs =
3345+
mkCmdArgs
3346+
(with hooks.rumdl.settings; [
3347+
[ (configuration != { }) " --config ${toml.generate ".rumdl.toml" configuration}" ]
3348+
]);
3349+
in
3350+
{
3351+
name = "rumdl";
3352+
description = "Style checker and linter for rumdl files.";
3353+
package = tools.rumdl;
3354+
entry = "${hooks.rumdl.package}/bin/rumdl check ${cmdArgs}";
3355+
files = "\\.md$";
3356+
};
33203357
mdformat = {
33213358
name = "mdformat";
33223359
description = "CommonMark compliant Markdown formatter";

nix/tools.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
, ripsecrets ? placeholder "ripsecrets"
7272
, reuse
7373
, ruff ? placeholder "ruff"
74+
, rumdl
7475
, rustfmt
7576
, selene
7677
, shellcheck
@@ -171,6 +172,7 @@ in
171172
revive
172173
ripsecrets
173174
ruff
175+
rumdl
174176
rustfmt
175177
selene
176178
shellcheck

0 commit comments

Comments
 (0)