Skip to content

Commit ff18ee0

Browse files
sugyanclaude
andcommitted
fix(codegen): Skip empty descriptions instead of emitting empty doc comments
`app.bsky.ageassurance.defs` carries `"description": ""`, which generated a bare `///` and tripped `clippy::empty_docs`. Since CI runs with `RUSTFLAGS: "-D warnings"`, that alone fails the build on regeneration. Treat an empty description the same as a missing one, both for the per-item `#[doc]` and the schema-level `#![doc]`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 785c0db commit ff18ee0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lexicon/atrium-codegen/src/generator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ pub(crate) fn generate_schemas(
6262

6363
let documentation = {
6464
let doc = format!("Definitions for the `{}` namespace.", schema.id);
65-
let description = if let Some(description) = &schema.description {
65+
let description = if let Some(description) =
66+
schema.description.as_deref().filter(|s| !s.is_empty())
67+
{
6668
quote!(#![doc = #description])
6769
} else {
6870
quote!()

lexicon/atrium-codegen/src/token_stream.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ fn unknown_type(unknown: &LexUnknown) -> Result<(TokenStream, TokenStream)> {
585585
}
586586

587587
fn description(description: &Option<String>) -> TokenStream {
588-
if let Some(description) = description {
588+
// An empty description would emit an empty doc comment, which trips `clippy::empty_docs`.
589+
if let Some(description) = description.as_deref().filter(|s| !s.is_empty()) {
589590
quote!(#[doc = #description])
590591
} else {
591592
quote!()

0 commit comments

Comments
 (0)