Concordium / concordium-rust-smart-contracts

Libraries and tools for writing and testing smart contracts on Concordium
https://docs.rs/concordium-std/latest/concordium_std/
Mozilla Public License 2.0
57 stars 35 forks source link

Generating documentation should not have warnings. #333

Closed abizjak closed 1 year ago

abizjak commented 1 year ago
 Documenting concordium-std v8.0.0 (/home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-std)
warning: unresolved link to `crate::types::AccountBalance`
   --> /home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-std/src/traits.rs:376:28
    |
376 |     /// [`AccountBalance`](crate::types::AccountBalance) for more.
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `AccountBalance` in module `types`
    |
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `AccountPublicKeys`
   --> /home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-std/src/types.rs:695:53
    |
695 | /// [`QueryAccountPublicKeysError`] and result to [`AccountPublicKeys`].
    |                                                     ^^^^^^^^^^^^^^^^^ no item named `AccountPublicKeys` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `Self::setup_hash_sha2_256_mock`
   --> /home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-std/src/test_infrastructure.rs:783:37
    |
783 | ...sha_256_mock`](Self::setup_hash_sha2_256_mock) method.
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `TestCryptoPrimitives` has no field or associated item named `setup_hash_sha2_256_mock`

warning: `concordium-std` (lib doc) generated 3 warnings
 Documenting concordium-cis2 v5.0.0 (/home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-cis2)
warning: could not parse code block as Rust code
  --> /home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-cis2/src/lib.rs:13:5
   |
13 |   //! ```ignore
   |  _____^
14 | | //! type TransferParameter = TransferParams<TokenIdVec>;
15 | | //!
16 | | //! #[receive(contract = "MyTokenContract", name = "transfer", paramet...
...  |
31 | | //! When `u256_amount` feature is enabled the type [`TokenAmountU256`]...
32 | | //! and implements the [`IsTokenAmount`] interface.
   | |___________________________________________________^
   |
help: `ignore` code blocks require valid Rust code for syntax highlighting; mark blocks that do not contain Rust code as text: ```text
  --> /home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-cis2/src/lib.rs:13:5
   |
13 | //! ```ignore
   |     ^^^
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: error from rustc: unknown start of token: `
   = note: `#[warn(rustdoc::invalid_rust_codeblocks)]` on by default

warning: unclosed HTML tag `u8`
  --> /home/abizjak/Private/Documents/Concordium/concordium-rust-smart-contracts/concordium-cis2/src/lib.rs:77:23
   |
77 | /// token ID using Vec<u8> is to allow smart contracts to use specialize...
   |                       ^^^^
   |
   = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
help: try marking as source code
   |
77 | /// token ID using `Vec<u8>` is to allow smart contracts to use specialized token
   |                    +       +

warning: `concordium-cis2` (lib doc) generated 2 warnings

When running cargo doc.

abizjak commented 1 year ago

We would ideally check this in CI.