Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/auth-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
//! tested against the shared vectors in `tests/sdk-vectors`.
// docs.rs labels feature-gated items with the features they need.
#![cfg_attr(docsrs, feature(doc_cfg))]
// A library leaves printing to its caller: it returns errors and logs through tracing.
#![warn(clippy::print_stdout, clippy::print_stderr)]

// Documented by its own inner docs, so their links resolve inside the module.
#[cfg(feature = "axum")]
Expand Down
2 changes: 2 additions & 0 deletions crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
//! - `sqlx`: decoding identifiers and vocabularies from `PostgreSQL` columns.
// docs.rs labels feature-gated items with the features they need.
#![cfg_attr(docsrs, feature(doc_cfg))]
// A library leaves printing to its caller: it returns errors and logs through tracing.
#![warn(clippy::print_stdout, clippy::print_stderr)]

/// Implements the conversions a text type's `#[serde(try_from = "String", into =
/// "String")]` names: it reads owned text through its `FromStr`, and writes what its
Expand Down
2 changes: 2 additions & 0 deletions crates/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//! Rust SDK; no browser or database policy.
// docs.rs labels feature-gated items with the features they need.
#![cfg_attr(docsrs, feature(doc_cfg))]
// A library leaves printing to its caller: it returns errors and logs through tracing.
#![warn(clippy::print_stdout, clippy::print_stderr)]
/// The one RS256 verifier auth and the SDK share, and compact JWS splitting.
mod jws;
/// Ed25519 signed notes, for audit checkpoints.
Expand Down
2 changes: 2 additions & 0 deletions crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//! `SQLx` error. Repositories expose only the operations used by the service, plus
//! read-only helpers and fixtures behind the `test-util` feature for other
//! crates' tests.
// A library leaves printing to its caller: it returns errors and logs through tracing.
#![warn(clippy::print_stdout, clippy::print_stderr)]
/// Validated `PostgreSQL` transport and bounded connection pools.
mod connection;
/// Typed persistence and connection failures.
Expand Down
2 changes: 2 additions & 0 deletions crates/telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
//!
//! Everything a span, log line or label holds may be exported. Never record a
//! secret, a request path or query string, or a request header.
// A library leaves printing to its caller: it returns errors and logs through tracing.
#![warn(clippy::print_stdout, clippy::print_stderr)]

/// OTLP export through the workspace's `reqwest`.
mod export;
Expand Down
2 changes: 2 additions & 0 deletions crates/ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
//! # Ok(())
//! # }
//! ```
// A library leaves printing to its caller: it returns errors and logs through tracing.
#![warn(clippy::print_stdout, clippy::print_stderr)]

/// The admin dashboard, and auth's page handing administrators off to it.
mod admin;
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/rust-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ use `?` when a conversion already exists. Do not use `Result<_, ()>` or producti
can quote personal data, and explain that exception in the code. Gate test helpers with `#[cfg(test)]`.
Clippy enforces this: it denies `unwrap`, `todo!` and `unimplemented!`
everywhere, and `expect`, `panic!` and `dbg!` outside tests (`clippy.toml`).
The library crates in `crates/` never print (`print_stdout`, `print_stderr`): they
return errors, and the application decides where output goes.

Helpers return the feature's domain error. Browser handlers return `ApiError`
through `From<DomainError>`; that exhaustive mapping owns public statuses and
Expand Down