typos 1.36.0__tar.gz → 1.36.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of typos might be problematic. Click here for more details.
- {typos-1.36.0 → typos-1.36.2}/Cargo.lock +129 -61
- {typos-1.36.0 → typos-1.36.2}/PKG-INFO +1 -1
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/Cargo.toml +4 -4
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/bin/typos-cli/report.rs +106 -209
- typos-1.36.2/crates/typos-cli/tests/cmd/filename-typo.in/README.md +4 -0
- {typos-1.36.0 → typos-1.36.2}/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/aho_corasick.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/gen.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/insensitive.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/map.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/match.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/ordered_map.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/dictgen/src/trie.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos/src/check.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos/src/dict.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos/src/tokens.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/bin/typos-cli/args.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/bin/typos-cli/main.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/config.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/default_types.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/dict.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/file.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/file_type.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/file_type_specifics.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/policy.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/src/report.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/tests/cmd/en-us.in/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-cli/tests/cmd/false-positives.in/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-dict/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-dict/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-dict/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-dict/src/word_codegen.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-vars/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-vars/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-vars/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/typos-vars/src/vars_codegen.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon/src/codegen.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon-core/Cargo.toml +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon-core/README.md +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon-core/src/borrowed.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon-core/src/lib.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/crates/varcon-core/src/parser.rs +0 -0
- {typos-1.36.0 → typos-1.36.2}/pyproject.toml +0 -0
|
@@ -49,6 +49,16 @@ dependencies = [
|
|
|
49
49
|
"memchr",
|
|
50
50
|
]
|
|
51
51
|
|
|
52
|
+
[[package]]
|
|
53
|
+
name = "annotate-snippets"
|
|
54
|
+
version = "0.12.2"
|
|
55
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
56
|
+
checksum = "982b1e014494ccc9d4737fa74eee118cd67b1905d781b7b9d03b32d77858593f"
|
|
57
|
+
dependencies = [
|
|
58
|
+
"anstyle",
|
|
59
|
+
"unicode-width",
|
|
60
|
+
]
|
|
61
|
+
|
|
52
62
|
[[package]]
|
|
53
63
|
name = "anstream"
|
|
54
64
|
version = "0.6.19"
|
|
@@ -550,12 +560,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
|
|
550
560
|
|
|
551
561
|
[[package]]
|
|
552
562
|
name = "errno"
|
|
553
|
-
version = "0.3.
|
|
563
|
+
version = "0.3.13"
|
|
554
564
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
555
|
-
checksum = "
|
|
565
|
+
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
|
|
556
566
|
dependencies = [
|
|
557
567
|
"libc",
|
|
558
|
-
"windows-sys 0.
|
|
568
|
+
"windows-sys 0.60.2",
|
|
559
569
|
]
|
|
560
570
|
|
|
561
571
|
[[package]]
|
|
@@ -775,6 +785,12 @@ version = "0.4.10"
|
|
|
775
785
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
776
786
|
checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
|
|
777
787
|
|
|
788
|
+
[[package]]
|
|
789
|
+
name = "linux-raw-sys"
|
|
790
|
+
version = "0.9.4"
|
|
791
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
792
|
+
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
|
|
793
|
+
|
|
778
794
|
[[package]]
|
|
779
795
|
name = "log"
|
|
780
796
|
version = "0.4.27"
|
|
@@ -1085,10 +1101,23 @@ dependencies = [
|
|
|
1085
1101
|
"bitflags 2.4.1",
|
|
1086
1102
|
"errno",
|
|
1087
1103
|
"libc",
|
|
1088
|
-
"linux-raw-sys",
|
|
1104
|
+
"linux-raw-sys 0.4.10",
|
|
1089
1105
|
"windows-sys 0.48.0",
|
|
1090
1106
|
]
|
|
1091
1107
|
|
|
1108
|
+
[[package]]
|
|
1109
|
+
name = "rustix"
|
|
1110
|
+
version = "1.0.8"
|
|
1111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1112
|
+
checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
|
|
1113
|
+
dependencies = [
|
|
1114
|
+
"bitflags 2.4.1",
|
|
1115
|
+
"errno",
|
|
1116
|
+
"libc",
|
|
1117
|
+
"linux-raw-sys 0.9.4",
|
|
1118
|
+
"windows-sys 0.60.2",
|
|
1119
|
+
]
|
|
1120
|
+
|
|
1092
1121
|
[[package]]
|
|
1093
1122
|
name = "rustversion"
|
|
1094
1123
|
version = "1.0.18"
|
|
@@ -1344,6 +1373,12 @@ dependencies = [
|
|
|
1344
1373
|
"syn 2.0.90",
|
|
1345
1374
|
]
|
|
1346
1375
|
|
|
1376
|
+
[[package]]
|
|
1377
|
+
name = "supports-unicode"
|
|
1378
|
+
version = "3.0.0"
|
|
1379
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1380
|
+
checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2"
|
|
1381
|
+
|
|
1347
1382
|
[[package]]
|
|
1348
1383
|
name = "syn"
|
|
1349
1384
|
version = "1.0.109"
|
|
@@ -1375,18 +1410,18 @@ dependencies = [
|
|
|
1375
1410
|
"cfg-if",
|
|
1376
1411
|
"fastrand",
|
|
1377
1412
|
"redox_syscall",
|
|
1378
|
-
"rustix",
|
|
1413
|
+
"rustix 0.38.19",
|
|
1379
1414
|
"windows-sys 0.48.0",
|
|
1380
1415
|
]
|
|
1381
1416
|
|
|
1382
1417
|
[[package]]
|
|
1383
1418
|
name = "terminal_size"
|
|
1384
|
-
version = "0.4.
|
|
1419
|
+
version = "0.4.3"
|
|
1385
1420
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1386
|
-
checksum = "
|
|
1421
|
+
checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0"
|
|
1387
1422
|
dependencies = [
|
|
1388
|
-
"rustix",
|
|
1389
|
-
"windows-sys 0.
|
|
1423
|
+
"rustix 1.0.8",
|
|
1424
|
+
"windows-sys 0.60.2",
|
|
1390
1425
|
]
|
|
1391
1426
|
|
|
1392
1427
|
[[package]]
|
|
@@ -1537,9 +1572,10 @@ dependencies = [
|
|
|
1537
1572
|
|
|
1538
1573
|
[[package]]
|
|
1539
1574
|
name = "typos-cli"
|
|
1540
|
-
version = "1.36.
|
|
1575
|
+
version = "1.36.2"
|
|
1541
1576
|
dependencies = [
|
|
1542
1577
|
"ahash",
|
|
1578
|
+
"annotate-snippets",
|
|
1543
1579
|
"anstream",
|
|
1544
1580
|
"anstyle",
|
|
1545
1581
|
"anyhow",
|
|
@@ -1570,6 +1606,8 @@ dependencies = [
|
|
|
1570
1606
|
"serde_json",
|
|
1571
1607
|
"serde_regex",
|
|
1572
1608
|
"snapbox",
|
|
1609
|
+
"supports-unicode",
|
|
1610
|
+
"terminal_size",
|
|
1573
1611
|
"thread_local",
|
|
1574
1612
|
"toml",
|
|
1575
1613
|
"trycmd",
|
|
@@ -1577,10 +1615,7 @@ dependencies = [
|
|
|
1577
1615
|
"typos",
|
|
1578
1616
|
"typos-dict",
|
|
1579
1617
|
"typos-vars",
|
|
1580
|
-
"unic-emoji-char",
|
|
1581
1618
|
"unicase",
|
|
1582
|
-
"unicode-segmentation",
|
|
1583
|
-
"unicode-width",
|
|
1584
1619
|
"varcon-core",
|
|
1585
1620
|
]
|
|
1586
1621
|
|
|
@@ -1615,47 +1650,6 @@ dependencies = [
|
|
|
1615
1650
|
"varcon-core",
|
|
1616
1651
|
]
|
|
1617
1652
|
|
|
1618
|
-
[[package]]
|
|
1619
|
-
name = "unic-char-property"
|
|
1620
|
-
version = "0.9.0"
|
|
1621
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1622
|
-
checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221"
|
|
1623
|
-
dependencies = [
|
|
1624
|
-
"unic-char-range",
|
|
1625
|
-
]
|
|
1626
|
-
|
|
1627
|
-
[[package]]
|
|
1628
|
-
name = "unic-char-range"
|
|
1629
|
-
version = "0.9.0"
|
|
1630
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1631
|
-
checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc"
|
|
1632
|
-
|
|
1633
|
-
[[package]]
|
|
1634
|
-
name = "unic-common"
|
|
1635
|
-
version = "0.9.0"
|
|
1636
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1637
|
-
checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc"
|
|
1638
|
-
|
|
1639
|
-
[[package]]
|
|
1640
|
-
name = "unic-emoji-char"
|
|
1641
|
-
version = "0.9.0"
|
|
1642
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1643
|
-
checksum = "0b07221e68897210270a38bde4babb655869637af0f69407f96053a34f76494d"
|
|
1644
|
-
dependencies = [
|
|
1645
|
-
"unic-char-property",
|
|
1646
|
-
"unic-char-range",
|
|
1647
|
-
"unic-ucd-version",
|
|
1648
|
-
]
|
|
1649
|
-
|
|
1650
|
-
[[package]]
|
|
1651
|
-
name = "unic-ucd-version"
|
|
1652
|
-
version = "0.9.0"
|
|
1653
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1654
|
-
checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4"
|
|
1655
|
-
dependencies = [
|
|
1656
|
-
"unic-common",
|
|
1657
|
-
]
|
|
1658
|
-
|
|
1659
1653
|
[[package]]
|
|
1660
1654
|
name = "unicase"
|
|
1661
1655
|
version = "2.8.1"
|
|
@@ -1668,12 +1662,6 @@ version = "1.0.12"
|
|
|
1668
1662
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1669
1663
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
|
1670
1664
|
|
|
1671
|
-
[[package]]
|
|
1672
|
-
name = "unicode-segmentation"
|
|
1673
|
-
version = "1.12.0"
|
|
1674
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1675
|
-
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
|
|
1676
|
-
|
|
1677
1665
|
[[package]]
|
|
1678
1666
|
name = "unicode-width"
|
|
1679
1667
|
version = "0.2.1"
|
|
@@ -1809,6 +1797,12 @@ version = "0.4.0"
|
|
|
1809
1797
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1810
1798
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
1811
1799
|
|
|
1800
|
+
[[package]]
|
|
1801
|
+
name = "windows-link"
|
|
1802
|
+
version = "0.1.3"
|
|
1803
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1804
|
+
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
|
1805
|
+
|
|
1812
1806
|
[[package]]
|
|
1813
1807
|
name = "windows-sys"
|
|
1814
1808
|
version = "0.48.0"
|
|
@@ -1827,6 +1821,15 @@ dependencies = [
|
|
|
1827
1821
|
"windows-targets 0.52.6",
|
|
1828
1822
|
]
|
|
1829
1823
|
|
|
1824
|
+
[[package]]
|
|
1825
|
+
name = "windows-sys"
|
|
1826
|
+
version = "0.60.2"
|
|
1827
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1828
|
+
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
|
1829
|
+
dependencies = [
|
|
1830
|
+
"windows-targets 0.53.3",
|
|
1831
|
+
]
|
|
1832
|
+
|
|
1830
1833
|
[[package]]
|
|
1831
1834
|
name = "windows-targets"
|
|
1832
1835
|
version = "0.48.5"
|
|
@@ -1851,13 +1854,30 @@ dependencies = [
|
|
|
1851
1854
|
"windows_aarch64_gnullvm 0.52.6",
|
|
1852
1855
|
"windows_aarch64_msvc 0.52.6",
|
|
1853
1856
|
"windows_i686_gnu 0.52.6",
|
|
1854
|
-
"windows_i686_gnullvm",
|
|
1857
|
+
"windows_i686_gnullvm 0.52.6",
|
|
1855
1858
|
"windows_i686_msvc 0.52.6",
|
|
1856
1859
|
"windows_x86_64_gnu 0.52.6",
|
|
1857
1860
|
"windows_x86_64_gnullvm 0.52.6",
|
|
1858
1861
|
"windows_x86_64_msvc 0.52.6",
|
|
1859
1862
|
]
|
|
1860
1863
|
|
|
1864
|
+
[[package]]
|
|
1865
|
+
name = "windows-targets"
|
|
1866
|
+
version = "0.53.3"
|
|
1867
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1868
|
+
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
|
|
1869
|
+
dependencies = [
|
|
1870
|
+
"windows-link",
|
|
1871
|
+
"windows_aarch64_gnullvm 0.53.0",
|
|
1872
|
+
"windows_aarch64_msvc 0.53.0",
|
|
1873
|
+
"windows_i686_gnu 0.53.0",
|
|
1874
|
+
"windows_i686_gnullvm 0.53.0",
|
|
1875
|
+
"windows_i686_msvc 0.53.0",
|
|
1876
|
+
"windows_x86_64_gnu 0.53.0",
|
|
1877
|
+
"windows_x86_64_gnullvm 0.53.0",
|
|
1878
|
+
"windows_x86_64_msvc 0.53.0",
|
|
1879
|
+
]
|
|
1880
|
+
|
|
1861
1881
|
[[package]]
|
|
1862
1882
|
name = "windows_aarch64_gnullvm"
|
|
1863
1883
|
version = "0.48.5"
|
|
@@ -1870,6 +1890,12 @@ version = "0.52.6"
|
|
|
1870
1890
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1871
1891
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
|
1872
1892
|
|
|
1893
|
+
[[package]]
|
|
1894
|
+
name = "windows_aarch64_gnullvm"
|
|
1895
|
+
version = "0.53.0"
|
|
1896
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1897
|
+
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
|
1898
|
+
|
|
1873
1899
|
[[package]]
|
|
1874
1900
|
name = "windows_aarch64_msvc"
|
|
1875
1901
|
version = "0.48.5"
|
|
@@ -1882,6 +1908,12 @@ version = "0.52.6"
|
|
|
1882
1908
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1883
1909
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
|
1884
1910
|
|
|
1911
|
+
[[package]]
|
|
1912
|
+
name = "windows_aarch64_msvc"
|
|
1913
|
+
version = "0.53.0"
|
|
1914
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1915
|
+
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
|
1916
|
+
|
|
1885
1917
|
[[package]]
|
|
1886
1918
|
name = "windows_i686_gnu"
|
|
1887
1919
|
version = "0.48.5"
|
|
@@ -1894,12 +1926,24 @@ version = "0.52.6"
|
|
|
1894
1926
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1895
1927
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
|
1896
1928
|
|
|
1929
|
+
[[package]]
|
|
1930
|
+
name = "windows_i686_gnu"
|
|
1931
|
+
version = "0.53.0"
|
|
1932
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1933
|
+
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
|
1934
|
+
|
|
1897
1935
|
[[package]]
|
|
1898
1936
|
name = "windows_i686_gnullvm"
|
|
1899
1937
|
version = "0.52.6"
|
|
1900
1938
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1901
1939
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
|
1902
1940
|
|
|
1941
|
+
[[package]]
|
|
1942
|
+
name = "windows_i686_gnullvm"
|
|
1943
|
+
version = "0.53.0"
|
|
1944
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1945
|
+
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
|
1946
|
+
|
|
1903
1947
|
[[package]]
|
|
1904
1948
|
name = "windows_i686_msvc"
|
|
1905
1949
|
version = "0.48.5"
|
|
@@ -1912,6 +1956,12 @@ version = "0.52.6"
|
|
|
1912
1956
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1913
1957
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
|
1914
1958
|
|
|
1959
|
+
[[package]]
|
|
1960
|
+
name = "windows_i686_msvc"
|
|
1961
|
+
version = "0.53.0"
|
|
1962
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1963
|
+
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
|
1964
|
+
|
|
1915
1965
|
[[package]]
|
|
1916
1966
|
name = "windows_x86_64_gnu"
|
|
1917
1967
|
version = "0.48.5"
|
|
@@ -1924,6 +1974,12 @@ version = "0.52.6"
|
|
|
1924
1974
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1925
1975
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
|
1926
1976
|
|
|
1977
|
+
[[package]]
|
|
1978
|
+
name = "windows_x86_64_gnu"
|
|
1979
|
+
version = "0.53.0"
|
|
1980
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1981
|
+
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
|
|
1982
|
+
|
|
1927
1983
|
[[package]]
|
|
1928
1984
|
name = "windows_x86_64_gnullvm"
|
|
1929
1985
|
version = "0.48.5"
|
|
@@ -1936,6 +1992,12 @@ version = "0.52.6"
|
|
|
1936
1992
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1937
1993
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
|
1938
1994
|
|
|
1995
|
+
[[package]]
|
|
1996
|
+
name = "windows_x86_64_gnullvm"
|
|
1997
|
+
version = "0.53.0"
|
|
1998
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1999
|
+
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
|
|
2000
|
+
|
|
1939
2001
|
[[package]]
|
|
1940
2002
|
name = "windows_x86_64_msvc"
|
|
1941
2003
|
version = "0.48.5"
|
|
@@ -1948,6 +2010,12 @@ version = "0.52.6"
|
|
|
1948
2010
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1949
2011
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|
1950
2012
|
|
|
2013
|
+
[[package]]
|
|
2014
|
+
name = "windows_x86_64_msvc"
|
|
2015
|
+
version = "0.53.0"
|
|
2016
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2017
|
+
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
|
|
2018
|
+
|
|
1951
2019
|
[[package]]
|
|
1952
2020
|
name = "winnow"
|
|
1953
2021
|
version = "0.7.12"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "typos-cli"
|
|
3
|
-
version = "1.36.
|
|
3
|
+
version = "1.36.2"
|
|
4
4
|
description = "Source Code Spelling Correction"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
categories = ["development-tools", "text-processing"]
|
|
@@ -60,15 +60,12 @@ difflib = "0.4"
|
|
|
60
60
|
proc-exit = "2.0"
|
|
61
61
|
human-panic = "2.0.3"
|
|
62
62
|
content_inspector = "0.2.4"
|
|
63
|
-
unicode-segmentation = "1.11.0"
|
|
64
63
|
derive_more = { version = "2.0", features = ["from", "display"] }
|
|
65
64
|
derive_setters = "0.1"
|
|
66
65
|
itertools = "0.14"
|
|
67
66
|
serde_json = "1.0"
|
|
68
67
|
kstring = { version = "2.0.0", features = ["serde"] }
|
|
69
68
|
typed-arena = "2.0.2"
|
|
70
|
-
unicode-width = "0.2.0"
|
|
71
|
-
unic-emoji-char = "0.9.0"
|
|
72
69
|
thread_local = "1.1.8"
|
|
73
70
|
globset = "0.4.14"
|
|
74
71
|
anstyle = "1.0.6"
|
|
@@ -79,6 +76,9 @@ regex = "1.10.4"
|
|
|
79
76
|
encoding_rs = "0.8.34"
|
|
80
77
|
serde-sarif = "0.7.0"
|
|
81
78
|
schemars = { version = "0.9.0", features = ["preserve_order","semver1"], optional = true }
|
|
79
|
+
annotate-snippets = "0.12.2"
|
|
80
|
+
terminal_size = "0.4.3"
|
|
81
|
+
supports-unicode = "3.0.0"
|
|
82
82
|
|
|
83
83
|
[dev-dependencies]
|
|
84
84
|
assert_fs = "1.1"
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
#![allow(clippy::needless_update)]
|
|
2
2
|
|
|
3
|
+
use std::borrow::Cow;
|
|
3
4
|
use std::io::Write as _;
|
|
5
|
+
use std::ops::Range;
|
|
4
6
|
use std::sync::{atomic, Mutex};
|
|
5
7
|
|
|
8
|
+
use annotate_snippets::Annotation;
|
|
9
|
+
use annotate_snippets::AnnotationKind;
|
|
10
|
+
use annotate_snippets::Group;
|
|
11
|
+
use annotate_snippets::Level;
|
|
12
|
+
use annotate_snippets::Origin;
|
|
13
|
+
use annotate_snippets::Snippet;
|
|
14
|
+
use anstream::stderr;
|
|
6
15
|
use anstream::stdout;
|
|
7
16
|
use serde_sarif::sarif;
|
|
8
17
|
use serde_sarif::sarif::{ArtifactChange, ArtifactContent, Fix, Replacement};
|
|
9
|
-
use typos_cli::report::{Context, Message, Report, Typo};
|
|
10
|
-
use unicode_width::UnicodeWidthStr;
|
|
18
|
+
use typos_cli::report::{Context, Error, Message, Report, Typo};
|
|
11
19
|
|
|
12
|
-
const ERROR: anstyle::Style = anstyle::AnsiColor::BrightRed.on_default();
|
|
13
20
|
const INFO: anstyle::Style = anstyle::AnsiColor::BrightBlue.on_default();
|
|
14
|
-
const GOOD: anstyle::Style = anstyle::AnsiColor::BrightGreen.on_default();
|
|
15
21
|
|
|
16
22
|
pub(crate) struct MessageStatus<'r> {
|
|
17
23
|
typos_found: atomic::AtomicBool,
|
|
@@ -66,11 +72,15 @@ pub(crate) struct PrintBrief;
|
|
|
66
72
|
|
|
67
73
|
impl Report for PrintBrief {
|
|
68
74
|
fn report(&self, msg: Message<'_>) -> Result<(), std::io::Error> {
|
|
75
|
+
let renderer = RENDERER.clone().short_message(true);
|
|
69
76
|
match &msg {
|
|
70
77
|
Message::BinaryFile(msg) => {
|
|
71
78
|
log::info!("{msg}");
|
|
72
79
|
}
|
|
73
|
-
Message::Typo(msg) =>
|
|
80
|
+
Message::Typo(msg) => {
|
|
81
|
+
let report = &[typo_to_group(msg)];
|
|
82
|
+
writeln!(stdout(), "{}", renderer.render(report))?;
|
|
83
|
+
}
|
|
74
84
|
Message::FileType(msg) => {
|
|
75
85
|
let info = INFO.render();
|
|
76
86
|
let reset = anstyle::Reset.render();
|
|
@@ -88,7 +98,8 @@ impl Report for PrintBrief {
|
|
|
88
98
|
writeln!(stdout().lock(), "{}", msg.data)?;
|
|
89
99
|
}
|
|
90
100
|
Message::Error(msg) => {
|
|
91
|
-
|
|
101
|
+
let report = &[error_to_group(msg)];
|
|
102
|
+
writeln!(stderr(), "{}", renderer.render(report))?;
|
|
92
103
|
}
|
|
93
104
|
_ => unimplemented!("New message {:?}", msg),
|
|
94
105
|
}
|
|
@@ -104,7 +115,10 @@ impl Report for PrintLong {
|
|
|
104
115
|
Message::BinaryFile(msg) => {
|
|
105
116
|
log::info!("{msg}");
|
|
106
117
|
}
|
|
107
|
-
Message::Typo(msg) =>
|
|
118
|
+
Message::Typo(msg) => {
|
|
119
|
+
let report = &[typo_to_group(msg)];
|
|
120
|
+
writeln!(stdout(), "{}", RENDERER.render(report))?;
|
|
121
|
+
}
|
|
108
122
|
Message::FileType(msg) => {
|
|
109
123
|
let info = INFO.render();
|
|
110
124
|
let reset = anstyle::Reset.render();
|
|
@@ -122,7 +136,8 @@ impl Report for PrintLong {
|
|
|
122
136
|
writeln!(stdout().lock(), "{}", msg.data)?;
|
|
123
137
|
}
|
|
124
138
|
Message::Error(msg) => {
|
|
125
|
-
|
|
139
|
+
let report = &[error_to_group(msg)];
|
|
140
|
+
writeln!(stderr(), "{}", RENDERER.render(report))?;
|
|
126
141
|
}
|
|
127
142
|
_ => unimplemented!("New message {:?}", msg),
|
|
128
143
|
}
|
|
@@ -130,150 +145,109 @@ impl Report for PrintLong {
|
|
|
130
145
|
}
|
|
131
146
|
}
|
|
132
147
|
|
|
133
|
-
fn
|
|
134
|
-
let
|
|
135
|
-
|
|
136
|
-
let info = INFO.render();
|
|
137
|
-
let reset = anstyle::Reset.render();
|
|
138
|
-
|
|
139
|
-
let start = String::from_utf8_lossy(&msg.buffer[0..msg.byte_offset]);
|
|
140
|
-
let column_number =
|
|
141
|
-
unicode_segmentation::UnicodeSegmentation::graphemes(start.as_ref(), true).count() + 1;
|
|
142
|
-
match &msg.corrections {
|
|
143
|
-
typos::Status::Valid => {}
|
|
148
|
+
fn typo_to_group<'t>(msg: &'t Typo<'t>) -> Group<'t> {
|
|
149
|
+
let title = match &msg.corrections {
|
|
150
|
+
typos::Status::Valid => unimplemented!("never valid words to report"),
|
|
144
151
|
typos::Status::Invalid => {
|
|
145
|
-
|
|
146
|
-
writeln!(
|
|
147
|
-
stdout().lock(),
|
|
148
|
-
"{info}{}{divider}{column_number}{reset}: `{error}{}{reset}` is disallowed",
|
|
149
|
-
context_display(&msg.context),
|
|
150
|
-
msg.typo,
|
|
151
|
-
)?;
|
|
152
|
+
format!("`{}` is disallowed", msg.typo,)
|
|
152
153
|
}
|
|
153
154
|
typos::Status::Corrections(corrections) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
stdout().lock(),
|
|
157
|
-
"{info}{}{divider}{column_number}{reset}: `{error}{}{reset}` -> {}",
|
|
158
|
-
context_display(&msg.context),
|
|
155
|
+
format!(
|
|
156
|
+
"`{}` should be {}",
|
|
159
157
|
msg.typo,
|
|
160
|
-
itertools::join(
|
|
161
|
-
|
|
162
|
-
", "
|
|
163
|
-
)
|
|
164
|
-
)?;
|
|
158
|
+
itertools::join(corrections.iter().map(|s| format!("`{s}`")), ", ")
|
|
159
|
+
)
|
|
165
160
|
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
};
|
|
162
|
+
let group = Group::with_title(Level::ERROR.primary_title(Cow::Owned(title)));
|
|
163
|
+
let group = match &msg.context {
|
|
164
|
+
Some(Context::File(context)) => {
|
|
165
|
+
let path = context.path.as_os_str().to_string_lossy();
|
|
166
|
+
let (line, span) = to_string(&msg.buffer, msg.byte_offset, msg.typo.len());
|
|
167
|
+
let snippet = Snippet::source(line)
|
|
168
|
+
.path(path)
|
|
169
|
+
.line_start(context.line_num);
|
|
170
|
+
append_corrections(span, snippet, group)
|
|
171
|
+
}
|
|
172
|
+
Some(Context::Path(context)) => {
|
|
173
|
+
let parent = context.path.parent().unwrap_or(std::path::Path::new("."));
|
|
174
|
+
let parent = parent.as_os_str().to_string_lossy();
|
|
175
|
+
let mut line = parent.into_owned();
|
|
176
|
+
line.push(std::path::MAIN_SEPARATOR);
|
|
177
|
+
let parent_len = line.len();
|
|
178
|
+
let mut line = line.into_bytes();
|
|
179
|
+
line.extend(msg.buffer.iter());
|
|
180
|
+
let (line, span) = to_string(&line, parent_len + msg.byte_offset, msg.typo.len());
|
|
181
|
+
let line = line.into_owned();
|
|
182
|
+
let snippet = Snippet::source(line);
|
|
183
|
+
append_corrections(span, snippet, group)
|
|
184
|
+
}
|
|
185
|
+
Some(_) | None => group,
|
|
186
|
+
};
|
|
187
|
+
group
|
|
169
188
|
}
|
|
170
189
|
|
|
171
|
-
fn
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
190
|
+
fn append_corrections<'t>(
|
|
191
|
+
span: Range<usize>,
|
|
192
|
+
snippet: Snippet<'t, Annotation<'t>>,
|
|
193
|
+
group: Group<'t>,
|
|
194
|
+
) -> Group<'t> {
|
|
195
|
+
let snippet = snippet.annotation(AnnotationKind::Primary.span(span));
|
|
196
|
+
group.element(snippet)
|
|
197
|
+
}
|
|
176
198
|
|
|
177
|
-
|
|
178
|
-
let
|
|
199
|
+
fn to_string(line: &[u8], start: usize, len: usize) -> (Cow<'_, str>, Range<usize>) {
|
|
200
|
+
let end = start + len;
|
|
179
201
|
|
|
180
|
-
let line =
|
|
181
|
-
|
|
182
|
-
let start = String::from_utf8_lossy(&msg.buffer[0..msg.byte_offset]);
|
|
183
|
-
let column_number =
|
|
184
|
-
unicode_segmentation::UnicodeSegmentation::graphemes(start.as_ref(), true).count() + 1;
|
|
185
|
-
match &msg.corrections {
|
|
186
|
-
typos::Status::Valid => {}
|
|
187
|
-
typos::Status::Invalid => {
|
|
188
|
-
writeln!(
|
|
189
|
-
handle,
|
|
190
|
-
"{error}error{reset}: `{error}{}{reset}` is disallowed",
|
|
191
|
-
msg.typo,
|
|
192
|
-
)?;
|
|
193
|
-
}
|
|
194
|
-
typos::Status::Corrections(corrections) => {
|
|
195
|
-
writeln!(
|
|
196
|
-
handle,
|
|
197
|
-
"{error}error{reset}: `{error}{}{reset}` should be {}",
|
|
198
|
-
msg.typo,
|
|
199
|
-
itertools::join(
|
|
200
|
-
corrections.iter().map(|s| format!("`{good}{s}{reset}`")),
|
|
201
|
-
", "
|
|
202
|
-
)
|
|
203
|
-
)?;
|
|
204
|
-
}
|
|
202
|
+
if let Ok(line) = std::str::from_utf8(line) {
|
|
203
|
+
return (Cow::Borrowed(line), start..end);
|
|
205
204
|
}
|
|
206
|
-
let divider = ":";
|
|
207
|
-
writeln!(
|
|
208
|
-
handle,
|
|
209
|
-
"{info} --> {reset}{}{divider}{column_number}",
|
|
210
|
-
context_display(&msg.context),
|
|
211
|
-
)?;
|
|
212
205
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
let line_indent: String = itertools::repeat_n(" ", line_num.len()).collect();
|
|
216
|
-
let line = line.trim_end();
|
|
217
|
-
|
|
218
|
-
let visible_column = calculate_visible_column_width(start.as_ref());
|
|
219
|
-
let visible_len = calculate_visible_column_width(msg.typo);
|
|
220
|
-
|
|
221
|
-
let hl_indent: String = itertools::repeat_n(" ", visible_column).collect();
|
|
222
|
-
let hl: String = itertools::repeat_n("^", visible_len).collect();
|
|
223
|
-
|
|
224
|
-
writeln!(handle, "{info}{line_indent} |{reset}")?;
|
|
225
|
-
writeln!(handle, "{info}{line_num} |{reset} {line}")?;
|
|
226
|
-
writeln!(
|
|
227
|
-
handle,
|
|
228
|
-
"{info}{line_indent} |{reset} {hl_indent}{error}{hl}{reset}",
|
|
229
|
-
)?;
|
|
230
|
-
writeln!(handle, "{info}{line_indent} |{reset}")?;
|
|
231
|
-
}
|
|
206
|
+
let prefix = &line[0..start];
|
|
207
|
+
let prefix = String::from_utf8_lossy(prefix);
|
|
232
208
|
|
|
233
|
-
|
|
234
|
-
|
|
209
|
+
let middle = &line[start..end];
|
|
210
|
+
let middle = String::from_utf8_lossy(middle);
|
|
235
211
|
|
|
236
|
-
|
|
237
|
-
let
|
|
238
|
-
let graphemes = unicode_segmentation::UnicodeSegmentation::graphemes(str, true);
|
|
239
|
-
for grapheme in graphemes {
|
|
240
|
-
result += if grapheme == "\t" {
|
|
241
|
-
// TODO: config tab width
|
|
242
|
-
1
|
|
243
|
-
} else if is_emoji(grapheme) {
|
|
244
|
-
// UnicodeWidthStr::width doesn't cover for emoji according to their README.
|
|
245
|
-
// See: https://github.com/unicode-rs/unicode-width#unicode-width
|
|
246
|
-
// Also, the actual rendered column width may differ from calculation, especially for emojis.
|
|
247
|
-
// In here, we expect emoji renderers should render this emoji properly.
|
|
248
|
-
2
|
|
249
|
-
} else {
|
|
250
|
-
UnicodeWidthStr::width(grapheme)
|
|
251
|
-
}
|
|
252
|
-
}
|
|
212
|
+
let suffix = &line[end..];
|
|
213
|
+
let suffix = String::from_utf8_lossy(suffix);
|
|
253
214
|
|
|
254
|
-
|
|
255
|
-
|
|
215
|
+
let span_start = prefix.len();
|
|
216
|
+
let span_end = span_start + middle.len();
|
|
256
217
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
218
|
+
(
|
|
219
|
+
Cow::Owned(format!("{prefix}{middle}{suffix}")),
|
|
220
|
+
span_start..span_end,
|
|
221
|
+
)
|
|
222
|
+
}
|
|
261
223
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
224
|
+
fn error_to_group<'e>(error: &'e Error<'e>) -> Group<'e> {
|
|
225
|
+
let group = Group::with_title(Level::ERROR.primary_title(&error.msg));
|
|
226
|
+
match &error.context {
|
|
227
|
+
Some(Context::File(context)) => group.element(
|
|
228
|
+
Origin::path(context.path.as_os_str().to_string_lossy()).line(context.line_num),
|
|
229
|
+
),
|
|
230
|
+
Some(Context::Path(context)) => {
|
|
231
|
+
group.element(Origin::path(context.path.as_os_str().to_string_lossy()))
|
|
265
232
|
}
|
|
233
|
+
Some(_) | None => group,
|
|
266
234
|
}
|
|
267
|
-
|
|
268
|
-
false
|
|
269
235
|
}
|
|
270
236
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
237
|
+
static RENDERER: std::sync::LazyLock<annotate_snippets::Renderer> =
|
|
238
|
+
std::sync::LazyLock::new(|| {
|
|
239
|
+
let width = terminal_size::terminal_size()
|
|
240
|
+
.map(|(w, _)| w.0 as usize)
|
|
241
|
+
.unwrap_or(annotate_snippets::renderer::DEFAULT_TERM_WIDTH);
|
|
242
|
+
let decor_style = if supports_unicode::supports_unicode() {
|
|
243
|
+
annotate_snippets::renderer::DecorStyle::Unicode
|
|
244
|
+
} else {
|
|
245
|
+
annotate_snippets::renderer::DecorStyle::Ascii
|
|
246
|
+
};
|
|
247
|
+
annotate_snippets::Renderer::styled()
|
|
248
|
+
.term_width(width)
|
|
249
|
+
.decor_style(decor_style)
|
|
250
|
+
});
|
|
277
251
|
|
|
278
252
|
#[derive(Copy, Clone, Debug)]
|
|
279
253
|
pub(crate) struct PrintJson;
|
|
@@ -500,80 +474,3 @@ fn typo_to_sarif_location(msg: &Typo<'_>) -> Result<sarif::Location, Box<dyn std
|
|
|
500
474
|
Ok(location)
|
|
501
475
|
}
|
|
502
476
|
}
|
|
503
|
-
|
|
504
|
-
#[cfg(test)]
|
|
505
|
-
mod tests {
|
|
506
|
-
use super::*;
|
|
507
|
-
|
|
508
|
-
#[test]
|
|
509
|
-
fn test_calculate_visible_column_width_visible_ascii() {
|
|
510
|
-
for c in '!'..'~' {
|
|
511
|
-
assert_eq!(1, calculate_visible_column_width(&c.to_string()));
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
#[test]
|
|
516
|
-
fn test_calculate_visible_column_width_horizontal_tab() {
|
|
517
|
-
assert_eq!(1, calculate_visible_column_width("\t"));
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
#[test]
|
|
521
|
-
fn test_calculate_visible_column_width_latin_cyrillic() {
|
|
522
|
-
let latin_cyrillic_chars = [
|
|
523
|
-
"À", /* U+00C0; Latin Capital Letter A with Grave */
|
|
524
|
-
"À", /* U+0041 U+0300; Latin Capital Letter A, Combining Grave Accent */
|
|
525
|
-
"А", /* U+0410 Cyrillic Capital Letter A */
|
|
526
|
-
];
|
|
527
|
-
for (i, ch) in latin_cyrillic_chars.iter().enumerate() {
|
|
528
|
-
let width = calculate_visible_column_width(ch);
|
|
529
|
-
assert_eq!(1, width, "latin_cyrillic[{i}]: {ch}",);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
#[test]
|
|
534
|
-
fn test_calculate_visible_column_width_cjk() {
|
|
535
|
-
let cjk_chars = [
|
|
536
|
-
"中", /* U+4E2D */
|
|
537
|
-
"あ", /* U+3042 */
|
|
538
|
-
"한", /* U+1F635 U+200D U+1F4AB, NFC Korean */
|
|
539
|
-
"한", /* U+1F441 U+FE0F U+200D U+1F5E8 U+FE0F, NFD Korean */
|
|
540
|
-
];
|
|
541
|
-
for (i, ch) in cjk_chars.iter().enumerate() {
|
|
542
|
-
let width = calculate_visible_column_width(ch);
|
|
543
|
-
assert_eq!(2, width, "cjk[{i}]: {ch}");
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
#[test]
|
|
548
|
-
fn test_calculate_visible_column_width_simple_emojis() {
|
|
549
|
-
// First non-component emojis of each groups in "Full Emoji List, v14.0"
|
|
550
|
-
// https://unicode.org/Public/emoji/14.0/emoji-test.txt
|
|
551
|
-
let simple_emojis = [
|
|
552
|
-
"😀", /* U+1F600 */
|
|
553
|
-
"👋", /* U+1F44B */
|
|
554
|
-
"🐵", /* U+1F435 */
|
|
555
|
-
"🍇", /* U+1F347 */
|
|
556
|
-
"🌍", /* U+1F30D */
|
|
557
|
-
"🎃", /* U+1F383 */
|
|
558
|
-
"👓", /* U+1F453 */
|
|
559
|
-
"🏧", /* U+1F3E7 */
|
|
560
|
-
"🏁", /* U+1F3C1 */
|
|
561
|
-
];
|
|
562
|
-
for (i, ch) in simple_emojis.iter().enumerate() {
|
|
563
|
-
let width = calculate_visible_column_width(ch);
|
|
564
|
-
assert_eq!(2, width, "emoji[{i}]: {ch}");
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
#[test]
|
|
569
|
-
fn test_calculate_visible_column_width_zwj_sequences() {
|
|
570
|
-
let zwj_sequences = [
|
|
571
|
-
"😵💫", /* U+1F635 U+200D U+1F4AB */
|
|
572
|
-
"👁️🗨️", /* U+1F441 U+FE0F U+200D U+1F5E8 U+FE0F */
|
|
573
|
-
];
|
|
574
|
-
for (i, ch) in zwj_sequences.iter().enumerate() {
|
|
575
|
-
let width = calculate_visible_column_width(ch);
|
|
576
|
-
assert_eq!(2, width, "zwj[{i}]: {ch}");
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|