mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
32 lines
654 B
Nix
32 lines
654 B
Nix
{
|
|
runCommand,
|
|
markdown-code-runner,
|
|
nixfmt-rfc-style,
|
|
}:
|
|
|
|
runCommand "manual_check-nix-code-blocks"
|
|
{
|
|
nativeBuildInputs = [
|
|
markdown-code-runner
|
|
nixfmt-rfc-style
|
|
];
|
|
}
|
|
''
|
|
set +e
|
|
|
|
mdcr --check --config ${./mdcr-config.toml} ${./..}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
cat <<EOF
|
|
Error: `mdcr` command failed. Please make sure the Nix code snippets in Markdown files are correctly formatted.
|
|
|
|
Run this command from the Nixpkgs repository root for automatic formatting:
|
|
|
|
mdcr --log debug --config ${toString ./..}/tests/mdcr-config.toml ${toString ./..}
|
|
|
|
EOF
|
|
exit 1
|
|
fi
|
|
|
|
touch "$out"
|
|
''
|