Skip to content

Commit

Permalink
style: format code with Prettier (#2502)
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in c188aba according to the output
from Prettier.

Details: None

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] authored Feb 14, 2024
1 parent 1c47411 commit d68b2ba
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
4 changes: 3 additions & 1 deletion packages/quicktype-core/src/language/CPlusPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,9 @@ export class CPlusPlusRenderer extends ConvenienceRenderer {
"; break;"
);
});
this.emitLine(`default: throw std::runtime_error("Unexpected value in enumeration \\"${enumName}\\": " + std::to_string(static_cast<int>(x)));`);
this.emitLine(
`default: throw std::runtime_error("Unexpected value in enumeration \\"${enumName}\\": " + std::to_string(static_cast<int>(x)));`
);
});
}
);
Expand Down
9 changes: 4 additions & 5 deletions packages/quicktype-core/src/language/CSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const cSharpOptions = {
"secondary"
),
checkRequired: new BooleanOption("check-required", "Fail if required properties are missing", false),
keepPropertyName: new BooleanOption("keep-property-name", "Keep original field name generate", false),
keepPropertyName: new BooleanOption("keep-property-name", "Keep original field name generate", false)
};

export class CSharpTargetLanguage extends TargetLanguage {
Expand Down Expand Up @@ -306,7 +306,6 @@ function csNameStyle(original: string): string {
}

function csNameStyleKeep(original: string): string {

const keywords = [
"abstract",
"as",
Expand Down Expand Up @@ -384,8 +383,8 @@ function csNameStyleKeep(original: string): string {
"virtual",
"void",
"volatile",
"while",
]
"while"
];

const words: WordInName[] = [
{
Expand All @@ -403,7 +402,7 @@ function csNameStyleKeep(original: string): string {
x => x,
"",
isStartCharacter
)
);

return keywords.includes(result) ? "@" + result : result;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/quicktype-core/src/language/Dart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ function dartNameStyle(startWithUpper: boolean, upperUnderscore: boolean, origin
const firstWordStyle = upperUnderscore
? allUpperWordStyle
: startWithUpper
? firstUpperWordStyle
: allLowerWordStyle;
? firstUpperWordStyle
: allLowerWordStyle;
const restWordStyle = upperUnderscore ? allUpperWordStyle : firstUpperWordStyle;
return combineWords(
words,
Expand Down
4 changes: 2 additions & 2 deletions packages/quicktype-core/src/language/Rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class RustTargetLanguage extends TargetLanguage {
rustOptions.derivePartialEq,
rustOptions.edition2018,
rustOptions.leadingComments,
rustOptions.skipSerializingNone,
rustOptions.skipSerializingNone
];
}
}
Expand Down Expand Up @@ -371,7 +371,7 @@ export class RustRenderer extends ConvenienceRenderer {
private emitSkipSerializeNone(t: Type) {
if (t instanceof UnionType) {
const nullable = nullableFromUnion(t);
if (nullable !== null) this.emitLine('#[serde(skip_serializing_if = "Option::is_none")]');
if (nullable !== null) this.emitLine('#[serde(skip_serializing_if = "Option::is_none")]');
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/quicktype-core/src/language/Scala3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ export class Scala3Renderer extends ConvenienceRenderer {
delimiter === "curly"
? ["{", "}"]
: delimiter === "paren"
? ["(", ")"]
: delimiter === "none"
? ["", ""]
: ["{", "})"];
? ["(", ")"]
: delimiter === "none"
? ["", ""]
: ["{", "})"];
this.emitLine(line, " ", open);
this.indent(f);
this.emitLine(close);
Expand Down
8 changes: 4 additions & 4 deletions packages/quicktype-core/src/language/Smithy4s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ export class Smithy4sRenderer extends ConvenienceRenderer {
delimiter === "curly"
? ["{", "}"]
: delimiter === "paren"
? ["(", ")"]
: delimiter === "none"
? ["", ""]
: ["{", "})"];
? ["(", ")"]
: delimiter === "none"
? ["", ""]
: ["{", "})"];
this.emitLine(line, " ", open);
this.indent(f);
this.emitLine(close);
Expand Down

0 comments on commit d68b2ba

Please sign in to comment.