Skip to content

Commit 548fc44

Browse files
authored
Merge pull request #664 from szaffarano/feat/rumdl
feat(rumdl): Add support for rumdl
2 parents 50b9238 + 5151f66 commit 548fc44

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
@@ -1623,6 +1623,28 @@ in
16231623
};
16241624
};
16251625
};
1626+
rumdl = mkOption {
1627+
description = "rumdl hook";
1628+
type = types.submodule {
1629+
imports = [ hookModule ];
1630+
options.settings = {
1631+
configuration =
1632+
mkOption {
1633+
type = types.attrs;
1634+
description =
1635+
"See https://github.com/rvben/rumdl?tab=readme-ov-file#configuration";
1636+
default = { };
1637+
example = {
1638+
configuration = {
1639+
MD013 = {
1640+
line-length = 100;
1641+
};
1642+
};
1643+
};
1644+
};
1645+
};
1646+
};
1647+
};
16261648
rustfmt = mkOption {
16271649
description = ''
16281650
Additional rustfmt settings
@@ -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";
@@ -3895,6 +3917,21 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
38953917
entry = "${hooks.ruff.package}/bin/ruff format";
38963918
types = [ "python" ];
38973919
};
3920+
rumdl =
3921+
let
3922+
cmdArgs =
3923+
mkCmdArgs
3924+
(with hooks.rumdl.settings; [
3925+
[ (configuration != { }) " --config ${toml.generate ".rumdl.toml" configuration}" ]
3926+
]);
3927+
in
3928+
{
3929+
name = "rumdl";
3930+
description = "Style checker and linter for rumdl files.";
3931+
package = tools.rumdl;
3932+
entry = "${hooks.rumdl.package}/bin/rumdl check ${cmdArgs}";
3933+
files = "\\.md$";
3934+
};
38983935
rustfmt =
38993936
let
39003937
mkAdditionalArgs = args: lib.optionalString (args != "") " -- ${args}";

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)