Skip to content

Commit f118377

Browse files
committed
chore(ci): enforce rustdoc warnings as errors
Add a docs step to CI with RUSTDOCFLAGS='-D warnings'. Also fix rustdoc issues uncovered by the gate (ambiguous intra-doc links and generic type markdown).
1 parent 62ae5eb commit f118377

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/rust.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,12 @@ jobs:
3232
- name: Build
3333
run: cargo build --workspace --all-targets --verbose
3434

35+
- name: Doc (warnings as errors)
36+
env:
37+
RUSTDOCFLAGS: "-D warnings"
38+
run: |
39+
cargo doc -p langcodec --no-deps
40+
cargo doc -p langcodec-cli --lib --no-deps
41+
3542
- name: Test
3643
run: cargo test --workspace --all-targets --verbose

langcodec-cli/src/transformers/langcodec_resource_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::fs;
22

3-
/// Transform a langcodec::Resource array JSON file to a Vec<Resource>.
3+
/// Transform a `langcodec::Resource` array JSON file to a `Vec<langcodec::Resource>`.
44
/// This format is a direct representation of langcodec::Resource objects in JSON.
55
pub fn transform(input: String) -> Result<Vec<langcodec::Resource>, String> {
66
// Read the file content

langcodec/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use serde::{Deserialize, Serialize};
66
use thiserror::Error;
77

8-
/// Stable machine-readable category for [`Error`].
8+
/// Stable machine-readable category for [`enum@Error`].
99
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1010
#[serde(rename_all = "snake_case")]
1111
pub enum ErrorCode {
@@ -39,7 +39,7 @@ pub struct ErrorContext {
3939
pub candidates: Vec<String>,
4040
}
4141

42-
/// Serializable structured representation of an [`Error`].
42+
/// Serializable structured representation of an [`enum@Error`].
4343
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
4444
pub struct StructuredError {
4545
pub code: ErrorCode,

0 commit comments

Comments
 (0)