Skip to content

Commit

Permalink
docs: --cfg=docsrs is now a default set by docs.rs (#190)
Browse files Browse the repository at this point in the history
It's no longer required to specify this in our package metadata.
  • Loading branch information
mbrobbel committed Jul 10, 2024
1 parent 53cb477 commit e56e646
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,18 @@ jobs:
rustdoc:
name: Rustdoc
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: dtolnay/rust-toolchain@nightly
id: rust-toolchain
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-rustdoc-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-rustdoc-
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
${{ runner.os }}-cargo-
- run: cargo rustdoc --all-features -- --cfg docsrs
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs
- run: mv "target/$(rustc -vV | awk '/^host/ { print $2 }')/doc" "target/doc"
- run: chmod -c -R +rX "target/doc"
- run: echo "<meta http-equiv=refresh content=0;url=substrait>" > target/doc/index.html
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ Or to enable automatic feature information (requires a nightly toolchain):
cargo +nightly rustdoc -- --cfg docsrs
```

Or use [cargo-doc-rs](https://crates.io/crates/cargo-docs-rs):

```
cargo +nightly docs-rs
```

### Formatting

All Rust code is formatted using [rustfmt](https://github.com/rust-lang/rustfmt):
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ walkdir = "2.5.0"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
2 changes: 1 addition & 1 deletion src/parse/proto/extensions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0

//! Parsing of [proto::extensions] types.
//! Parsing of [crate::proto::extensions] types.

mod simple_extension_uri;
pub use simple_extension_uri::SimpleExtensionUri;
3 changes: 2 additions & 1 deletion src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#![allow(
clippy::large_enum_variant,
clippy::needless_borrow,
clippy::needless_borrows_for_generic_args
clippy::needless_borrows_for_generic_args,
rustdoc::invalid_html_tags
)]

//! Generated types for the protobuf `substrait` package.
Expand Down

0 comments on commit e56e646

Please sign in to comment.