Skip to content

Commit 9107c7b

Browse files
committed
fix: apply coderabbitai suggestions
1 parent 49fad78 commit 9107c7b

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.changeset/chubby-bottles-lick.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"@biomejs/biome": patch
33
---
44

5-
Added the rule [`useDescriptionStyle`](https://biomejs.dev/linter/rules/use-description-style/), require all comments to follow the same format (either block or inline)
5+
Added the rule [`useDescriptionStyle`](https://biomejs.dev/linter/rules/use-description-style/), requiring all descriptions to follow the same style (either block or inline).
66

77
##### Invalid
88

crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use biome_rowan::AstNode;
77
use biome_rule_options::use_description_style::{Style, UseDescriptionStyleOptions};
88

99
declare_lint_rule! {
10-
/// Require all comments to follow the same style (either block or inline)
10+
/// Require all descriptions to follow the same style (either block or inline)
1111
///
1212
/// ## Examples
1313
///
@@ -56,6 +56,10 @@ impl Rule for UseDescriptionStyle {
5656
return Some(());
5757
}
5858

59+
if style == Style::Inline && value.is_block() {
60+
return Some(());
61+
}
62+
5963
None
6064
}
6165

@@ -68,7 +72,7 @@ impl Rule for UseDescriptionStyle {
6872
rule_category!(),
6973
span,
7074
markup! {
71-
"Unexpected "{if style == Style::Block { Style::Inline } else { Style::Block }}" description"
75+
"Unexpected "{if style == Style::Block { Style::Inline } else { Style::Block }}" description style."
7276
},
7377
)
7478
.note(markup! {

crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ enum EnumValue {
1919
```
2020
invalid.graphql:2:2 lint/nursery/useDescriptionStyle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2121
22-
i Unexpected inline description
22+
i Unexpected inline description style.
2323
2424
1 │ enum EnumValue {
2525
> 2"basic"
@@ -35,7 +35,7 @@ invalid.graphql:2:2 lint/nursery/useDescriptionStyle ━━━━━━━━━
3535
```
3636
invalid.graphql:4:2 lint/nursery/useDescriptionStyle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3737
38-
i Unexpected inline description
38+
i Unexpected inline description style.
3939
4040
2"basic"
4141
3BASIC
@@ -52,7 +52,7 @@ invalid.graphql:4:2 lint/nursery/useDescriptionStyle ━━━━━━━━━
5252
```
5353
invalid.graphql:6:2 lint/nursery/useDescriptionStyle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5454
55-
i Unexpected inline description
55+
i Unexpected inline description style.
5656
5757
4"fluent"
5858
5FLUENT

0 commit comments

Comments
 (0)