Skip to content

Commit a6a221a

Browse files
authored
Merge pull request #93 from Jules-Bertholet/more-ci-checks
More CI checks
2 parents 95aab8d + 261ca20 commit a6a221a

12 files changed

+638
-39
lines changed

Diff for: .github/workflows/rust.yml

+31-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ on:
77
branches: [ master ]
88

99
env:
10+
CARGO_INCREMENTAL: 0
1011
CARGO_TERM_COLOR: always
12+
RUST_BACKTRACE: 1
13+
RUSTFLAGS: -D warnings
14+
RUSTDOCFLAGS: -D warnings --cfg docsrs
1115

1216
jobs:
1317
build:
@@ -20,28 +24,50 @@ jobs:
2024
- nightly
2125
steps:
2226
- uses: actions/checkout@v2
23-
- name: Install latest nightly
27+
- name: Install toolchain
2428
uses: actions-rs/toolchain@v1
2529
with:
2630
toolchain: ${{ matrix.rust }}
2731
override: true
2832
- name: Build
2933
run: cargo build --verbose
30-
- name: Run tests
31-
run: cargo test --verbose
34+
- name: Run tests with all features
35+
run: cargo test --all-features --verbose
3236
- name: Run tests without features
33-
run: cargo test --verbose --no-default-features
37+
run: cargo test --no-default-features --verbose
3438
- name: Package
3539
run: cargo package
3640
- name: Test package
3741
run: cd $(find target/package/ -maxdepth 1 -mindepth 1 -type d) && cargo test
3842
- name: Test package without features
3943
run: cd $(find target/package/ -maxdepth 1 -mindepth 1 -type d) && cargo test --no-default-features
44+
- name: Build docs
45+
if: matrix.rust == 'nightly'
46+
run: cargo doc --all-features --verbose
47+
- name: Check formatting
48+
if: matrix.rust == 'stable'
49+
run: cargo fmt --all --check
50+
- name: Check clippy
51+
if: matrix.rust == 'stable'
52+
run: cargo clippy --all-features --all --verbose
53+
msrv:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v2
57+
- name: Install msrv toolchain
58+
uses: actions-rs/toolchain@v1
59+
with:
60+
toolchain: 1.36
61+
override: true
62+
- name: Build
63+
run: cargo build --verbose --all-features
4064
regen:
4165
runs-on: ubuntu-latest
4266
steps:
4367
- uses: actions/checkout@v3
4468
- name: Regen
4569
run: cd scripts && python3 unicode.py
46-
- name: Diff
70+
- name: Diff tables
4771
run: diff src/tables.rs scripts/tables.rs
72+
- name: Diff tests
73+
run: diff tests/data/normalization_tests.rs scripts/normalization_tests.rs

Diff for: Cargo.toml

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22

33
name = "unicode-normalization"
44
version = "0.1.23"
5-
authors = ["kwantam <[email protected]>", "Manish Goregaokar <[email protected]>"]
5+
authors = [
6+
"kwantam <[email protected]>",
7+
"Manish Goregaokar <[email protected]>",
8+
]
69

710
homepage = "https://github.com/unicode-rs/unicode-normalization"
811
repository = "https://github.com/unicode-rs/unicode-normalization"
912
documentation = "https://docs.rs/unicode-normalization/"
1013

1114
license = "MIT/Apache-2.0"
12-
keywords = ["text", "unicode", "normalization", "decomposition", "recomposition"]
15+
keywords = [
16+
"text",
17+
"unicode",
18+
"normalization",
19+
"decomposition",
20+
"recomposition",
21+
]
1322
readme = "README.md"
1423
description = """
1524
This crate provides functions for normalization of
@@ -18,9 +27,11 @@ Decomposition and Recomposition, as described in
1827
Unicode Standard Annex #15.
1928
"""
2029

30+
rust-version = "1.36"
31+
2132
edition = "2018"
2233

23-
exclude = [ "target/*", "Cargo.lock", "scripts/tmp", "*.txt", "tests/*" ]
34+
exclude = ["target/*", "Cargo.lock", "scripts/tmp", "*.txt", "tests/*"]
2435

2536
[dependencies.tinyvec]
2637
version = "1"

Diff for: scripts/unicode.py

100644100755
+1
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ def minimal_perfect_hash(d):
579579
data = UnicodeData()
580580
with open("tables.rs", "w", newline = "\n") as out:
581581
out.write(PREAMBLE)
582+
out.write("#![cfg_attr(rustfmt, rustfmt::skip)]\n")
582583
out.write("use crate::quick_check::IsNormalized;\n")
583584
out.write("use crate::quick_check::IsNormalized::*;\n")
584585
out.write("\n")

Diff for: src/__test_api.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// If you're caught using this outside this crates tests/, you get to clean up the mess.
66

77
#[cfg(not(feature = "std"))]
8-
use crate::no_std_prelude::*;
8+
use alloc::string::String;
99

1010
use crate::stream_safe::StreamSafe;
1111

Diff for: src/lib.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ pub use crate::recompose::Recompositions;
6262
pub use crate::replace::Replacements;
6363
pub use crate::stream_safe::StreamSafe;
6464
pub use crate::tables::UNICODE_VERSION;
65-
use core::{
66-
str::Chars,
67-
option,
68-
};
69-
70-
mod no_std_prelude;
65+
use core::{option, str::Chars};
7166

7267
mod decompose;
7368
mod lookups;
@@ -169,7 +164,6 @@ impl<'a> UnicodeNormalization<Chars<'a>> for &'a str {
169164
}
170165
}
171166

172-
173167
impl UnicodeNormalization<option::IntoIter<char>> for char {
174168
#[inline]
175169
fn nfd(self) -> Decompositions<option::IntoIter<char>> {

Diff for: src/no_std_prelude.rs

-6
This file was deleted.

Diff for: src/normalize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::lookups::{
1414
compatibility_fully_decomposed, composition_table,
1515
};
1616

17-
use core::{char, ops::FnMut};
17+
use core::char;
1818

1919
/// Compute canonical Unicode decomposition for character.
2020
/// See [Unicode Standard Annex #15](http://www.unicode.org/reports/tr15/)

Diff for: src/stream_safe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ mod tests {
114114
use crate::normalize::decompose_compatible;
115115

116116
#[cfg(not(feature = "std"))]
117-
use crate::no_std_prelude::*;
117+
use alloc::{string::String, vec::Vec};
118118

119119
use core::char;
120120

Diff for: src/tables.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly
1212

1313
#![allow(missing_docs)]
14+
#![cfg_attr(rustfmt, rustfmt::skip)]
1415
use crate::quick_check::IsNormalized;
1516
use crate::quick_check::IsNormalized::*;
1617

Diff for: src/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use super::UnicodeNormalization;
1313
use core::char;
1414

1515
#[cfg(not(feature = "std"))]
16-
use crate::no_std_prelude::*;
16+
use alloc::string::{String, ToString};
1717

1818
#[test]
1919
fn test_nfd() {

0 commit comments

Comments
 (0)