Skip to content

Commit

Permalink
Match CI doc testing with docs.rs. (#397)
Browse files Browse the repository at this point in the history
* Remove `-Zunstable-options -Zrustdoc-scrape-examples` from CI. It
wasn't even enabled for docs.rs and the examples we have lead to more
noise than anything in the docs, so not worth enabling scraping at this
point.
* Treat doc warnings as errors. Historically we've not done so due to
various `rustdoc` bugs giving false positives but I got it to pass
without failure right now, so perhaps better times have arrived.
* Pass `--all-features` at docs.rs to match our CI and reduce the
maintenance burden of manually syncing the features list.
* Target only `x86_64-unknown-linux-gnu` on docs.rs as we don't have any
platform specific docs.
  • Loading branch information
xStrom authored Nov 5, 2024
1 parent f4a77dc commit a44f3b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,17 @@ jobs:
with:
save-if: ${{ github.event_name != 'merge_group' }}

# We test documentation using nightly to match docs.rs. This prevents potential breakages
# We test documentation using nightly to match docs.rs.
- name: cargo doc
run: cargo doc --workspace --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples
run: cargo doc --workspace --locked --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: '--cfg docsrs'
RUSTDOCFLAGS: '--cfg docsrs -D warnings'

# If this fails, consider changing your text or adding something to .typos.toml
# If this fails, consider changing your text or adding something to .typos.toml.
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: check typos
uses: crate-ci/typos@v1.26.1
uses: crate-ci/typos@v1.27.0
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ readme = "README.md"
categories = ["graphics"]

[package.metadata.docs.rs]
features = ["mint", "schemars", "serde"]
all-features = true
# There are no platform specific docs.
default-target = "x86_64-unknown-linux-gnu"
targets = []

[lints]
# This can be removed once we fix the benchmarks.
Expand Down
2 changes: 1 addition & 1 deletion src/affine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Affine {
/// [Wikipedia](https://en.wikipedia.org/wiki/Affine_transformation)
/// formulation of affine transformation as augmented matrix. The
/// idea is that `(A * B) * v == A * (B * v)`, where `*` is the
/// [`Mul`](std::ops::Mul) trait.
/// [`Mul`] trait.
#[inline]
pub const fn new(c: [f64; 6]) -> Affine {
Affine(c)
Expand Down
2 changes: 1 addition & 1 deletion src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::common::FloatFuncs;

/// A 2D point.
///
/// This type represents a point in 2D space. It has the same layout as [`Vec2`][crate::Vec2], but
/// This type represents a point in 2D space. It has the same layout as [`Vec2`], but
/// its meaning is different: `Vec2` represents a change in location (for example velocity).
///
/// In general, `kurbo` overloads math operators where it makes sense, for example implementing
Expand Down

0 comments on commit a44f3b6

Please sign in to comment.