From 4cc390345a90db0f18f34815e6c5f196134cb8a8 Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Mon, 16 Dec 2024 02:07:42 -0800 Subject: [PATCH] don't markdownlint ignored files I like to put a bunch of untracked stuff in a /scratch directory for each project, and then puth /scratch in my global gitignore. There are usually some markdown notes files in here that I don't care about style for. The previous markdownlint invokation didn't respect the global gitignore, making local 'engage' runs kinda useless due to false positives from the scratch dir. --- engage.toml | 6 +++++- nix/shell.nix | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/engage.toml b/engage.toml index 3e5d4417..94c2bd5e 100644 --- a/engage.toml +++ b/engage.toml @@ -48,7 +48,11 @@ script = "lychee --offline ." [[task]] name = "markdownlint" group = "lints" -script = "markdownlint ." +# don't just use 'markdownlint .' because it will lint files that are ignored by +# git +script = """ +git ls-files --cached --others --exclude-standard '*.md' | xargs markdownlint +""" [[task]] name = "cargo-fmt" diff --git a/nix/shell.nix b/nix/shell.nix index 5e642001..34e9d5c2 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -2,6 +2,7 @@ { cargo-insta , default , engage +, findutils , inputs , jq , lychee @@ -32,6 +33,7 @@ mkShell { # Keep sorted cargo-insta engage + findutils jq lychee markdownlint-cli