Skip to content

Commit

Permalink
chore: fix checksum mismatch under Windows due to CRLF auto-conversio…
Browse files Browse the repository at this point in the history
…n by updating gitattributes
  • Loading branch information
Gowee committed May 15, 2023
1 parent f60b87f commit 8f4dcf2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Ref: https://stackoverflow.com/questions/19052834/is-it-possible-to-exclude-files-from-git-language-statistics
data/ZhConversion.php linguist-vendored
# Exclude external ruleset files from GitHub PL stats
# ref: https://stackoverflow.com/questions/19052834/is-it-possible-to-exclude-files-from-git-language-statistics
# And prevent auto CRLF conversion to avoid checksum mismatch
data/ZhConversion.php linguist-vendored binary
data/*.txt linguist-vendored binary
data/cgroups/*.json linguist-vendored
web/public/cgroups.json linguist-vendored
benches/*.txt linguist-vendored
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ fn read_and_validate_file(path: &str, sha256sum: &[u8; 32]) -> String {
assert_eq!(
&sha256(&content),
sha256sum,
"Validating the checksum of zhconv"
"Validating the checksum of {}",
path.display()
);
content
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! with the leftmost-longest matching strategy and linear time complexity with respect to the
//! length of input text and conversion rules. It ships with a bunch of conversion tables,
//! extracted from [zhConversion.php](https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/languages/data/ZhConversion.php)
//! which is maintained and used by MediaWiki and Chinese Wikipedia.
//! (maintained by MediaWiki and Chinese Wikipedia) and [OpenCC](https://github.com/BYVoid/OpenCC/tree/master/data/dictionary).
//!
//! While built-in datasets work well for general case, the converter is never meant to be 100%
//! accurate, especially for professional text. In Chinese Wikipedia, it is pretty common for
Expand Down

0 comments on commit 8f4dcf2

Please sign in to comment.