Skip to content

Commit 74e1a52

Browse files
authored
fix(typos): run with '--force-exclude' (#394)
This commit forces typos to ignore files explicitly passed as cli arguments, if they would otherwise be ignored based on typos' config. Previously, treefmt could explicitly pass files to typos that typos should otherwise ignore, which is expected behavior to typos but is not desirable when working with treefmt.
1 parent 4b25a4a commit 74e1a52

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/formatter-typos.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
command = "typos"
44
excludes = []
55
includes = ["*"]
6-
options = ["--write-changes"]
6+
options = ["--write-changes", "--force-exclude"]

programs/typos.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ in
1313
imports = [
1414
(mkFormatterModule {
1515
name = "typos";
16-
args = [ "--write-changes" ];
16+
args = [
17+
"--write-changes"
18+
19+
# Treefmt may pass files otherwise ignored by typos (e.g. files ignored in typos.toml).
20+
# '--force-exclude' stops typos from acting on any ignored files passed
21+
"--force-exclude"
22+
];
1723
includes = [ "*" ];
1824
})
1925
];

0 commit comments

Comments
 (0)