Skip to content

Commit a1fed78

Browse files
committed
chore: Add Typos configuration
1 parent 9014c2f commit a1fed78

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,24 @@ fluent-bundle = { version = "0.15.3", path = "fluent-bundle" }
4747
fluent-fallback = { version = "0.7.1", path = "fluent-fallback" }
4848
fluent-pseudo = { version = "0.3.2", path = "fluent-pseudo" }
4949
fluent-syntax = { version = "0.11.1", path = "fluent-syntax" }
50+
51+
[workspace.metadata.typos.default]
52+
locale = "en-us"
53+
extend-ignore-re = [
54+
"(?s)(#|//|/\\*)\\s*typos: ignore start.*?\\n\\s*(#|//|/\\*)\\s*typos: ignore end",
55+
]
56+
57+
[workspace.metadata.typos.default.extend-words]
58+
travelled = "travelled" # sadly part of a public API and fixing would be a breaking change
59+
nd = "nd" # appears frequently in inline test messages
60+
61+
[workspace.metadata.typos.files]
62+
ignore-hidden = false
63+
extend-exclude = [
64+
"/.git",
65+
"fluent-bundle/benches/**/*.ftl",
66+
"fluent-bundle/examples/**/*.ftl",
67+
"fluent-syntax/tests/fixtures/**/*.ftl",
68+
"fluent-syntax/tests/fixtures/**/*.json",
69+
"fluent-testing/resources/**/*.ftl",
70+
]

fluent-bundle/tests/builtins.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use fluent_syntax::ast::Pattern;
44
#[test]
55
fn test_builtin_number() {
66
// 1. Create bundle
7+
// typos: ignore start
78
let ftl_string = String::from(
89
r#"
910
count = { NUMBER($num, type: "cardinal") ->
@@ -17,6 +18,7 @@ order = { NUMBER($num, type: "ordinal") ->
1718
[few] {$num}rd
1819
}
1920
"#,
21+
// typos: ignore end
2022
);
2123

2224
let mut bundle = FluentBundle::default();

0 commit comments

Comments
 (0)