mirror of
https://github.com/typst/typst
synced 2025-05-19 11:35:27 +08:00
Check crate docs in CI
This commit is contained in:
parent
10fac14341
commit
7bb69c0902
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -3,6 +3,7 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: "-Dwarnings"
|
RUSTFLAGS: "-Dwarnings"
|
||||||
|
RUSTDOCFLAGS: "-Dwarnings"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
@ -16,14 +17,15 @@ jobs:
|
|||||||
- run: cargo test --workspace --no-fail-fast
|
- run: cargo test --workspace --no-fail-fast
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
name: Check formatting and clippy
|
name: Check clippy, formatting, and documentation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: cargo fmt --check --all
|
|
||||||
- run: cargo clippy --workspace --all-targets
|
- run: cargo clippy --workspace --all-targets
|
||||||
|
- run: cargo fmt --check --all
|
||||||
|
- run: cargo doc --workspace --no-deps
|
||||||
|
|
||||||
min-version:
|
min-version:
|
||||||
name: Check mininum Rust version
|
name: Check mininum Rust version
|
||||||
|
@ -134,7 +134,7 @@ impl ShapedGlyph {
|
|||||||
matches!(self.c, '《' | '(' | '『' | '「')
|
matches!(self.c, '《' | '(' | '『' | '「')
|
||||||
}
|
}
|
||||||
|
|
||||||
/// See https://www.w3.org/TR/clreq/#punctuation_width_adjustment
|
/// See <https://www.w3.org/TR/clreq/#punctuation_width_adjustment>
|
||||||
pub fn is_cjk_center_aligned_punctuation(&self, gb_style: bool) -> bool {
|
pub fn is_cjk_center_aligned_punctuation(&self, gb_style: bool) -> bool {
|
||||||
if !gb_style && matches!(self.c, ',' | '。' | '、' | ':' | ';') {
|
if !gb_style && matches!(self.c, ',' | '。' | '、' | ':' | ';') {
|
||||||
return true;
|
return true;
|
||||||
|
@ -14,12 +14,12 @@ Top level directory structure:
|
|||||||
## Running the tests
|
## Running the tests
|
||||||
Running all tests (including unit tests):
|
Running all tests (including unit tests):
|
||||||
```bash
|
```bash
|
||||||
cargo test --all
|
cargo test --workspace
|
||||||
```
|
```
|
||||||
|
|
||||||
Running just the integration tests (the tests in this directory):
|
Running just the integration tests (the tests in this directory):
|
||||||
```bash
|
```bash
|
||||||
cargo test --all --test tests
|
cargo test --workspace --test tests
|
||||||
```
|
```
|
||||||
|
|
||||||
You may want to [make yourself an alias](#making-an-alias) like:
|
You may want to [make yourself an alias](#making-an-alias) like:
|
||||||
@ -73,13 +73,13 @@ testit empty.typ
|
|||||||
### Bash
|
### Bash
|
||||||
Open your Bash configuration by executing `nano ~/.bashrc`.
|
Open your Bash configuration by executing `nano ~/.bashrc`.
|
||||||
```bash
|
```bash
|
||||||
alias testit="cargo test --all --test tests --"
|
alias testit="cargo test --workspace --test tests --"
|
||||||
```
|
```
|
||||||
|
|
||||||
### PowerShell
|
### PowerShell
|
||||||
Open your PowerShell profile by executing `notepad $profile`.
|
Open your PowerShell profile by executing `notepad $profile`.
|
||||||
```ps
|
```ps
|
||||||
function testit {
|
function testit {
|
||||||
cargo test --all --test tests -- $args
|
cargo test --workspace --test tests -- $args
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user