Skip to content

Commit 4e83748

Browse files
Reformat generated Scala classes (#416)
1 parent f0fc966 commit 4e83748

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

src/main/resources/templates/scala-lang/scalaClassGraphqlRequest.ftl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ${className} extends GraphQLOperationRequest {
6565
<#if field.deprecated>
6666
@Deprecated
6767
</#if>
68-
def set${field.name?cap_first}(${field.name}: ${field.type} ): Unit = {
68+
def set${field.name?cap_first}(${field.name}: ${field.type}): Unit = {
6969
this.input.put("${field.originalName}", ${field.name})
7070
}
7171

@@ -115,7 +115,7 @@ object ${className} {
115115
private var $alias: String = _
116116
<#if fields?has_content>
117117
<#list fields as field>
118-
private var ${field.name}: ${field.type} = <#if field.defaultValue?has_content> ${field.defaultValue} <#else>_</#if>
118+
private var ${field.name}: ${field.type} = <#if field.defaultValue?has_content>${field.defaultValue}<#else>_</#if>
119119
</#list>
120120
</#if>
121121

@@ -127,16 +127,16 @@ object ${className} {
127127
<#if fields?has_content>
128128
<#list fields as field>
129129
<#if field.javaDoc?has_content>
130-
/**
130+
/**
131131
<#list field.javaDoc as javaDocLine>
132-
* ${javaDocLine}
132+
* ${javaDocLine}
133133
</#list>
134-
*/
134+
*/
135135
</#if>
136136
<#if field.deprecated>
137137
@Deprecated
138138
</#if>
139-
def set${field.name?cap_first}(${field.name}: ${field.type} ): Builder = {
139+
def set${field.name?cap_first}(${field.name}: ${field.type}): Builder = {
140140
this.${field.name} = ${field.name}
141141
this
142142
}

src/main/resources/templates/scala-lang/scalaClassGraphqlResponseProjection.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ${className} extends GraphQLResponseProjection {
5858
<#if field.deprecated>
5959
@Deprecated
6060
</#if>
61-
def ${field.methodName}(<#if field.type?has_content>subProjection: ${field.type} </#if>): ${className} = {
61+
def ${field.methodName}(<#if field.type?has_content>subProjection: ${field.type}</#if>): ${className} = {
6262
${field.methodName}(<#if field.parametrizedInputClassName?has_content></#if>null.asInstanceOf[String]<#if field.type?has_content>, subProjection</#if>)
6363
}
6464

@@ -68,7 +68,7 @@ class ${className} extends GraphQLResponseProjection {
6868
}
6969

7070
<#if field.parametrizedInputClassName?has_content>
71-
def ${field.methodName}(input: ${field.parametrizedInputClassName}<#if field.type?has_content>,subProjection: ${field.type} </#if>): ${className} = {
71+
def ${field.methodName}(input: ${field.parametrizedInputClassName}<#if field.type?has_content>,subProjection: ${field.type}</#if>): ${className} = {
7272
${field.methodName}(null.asInstanceOf[String], input<#if field.type?has_content>, subProjection</#if>)
7373
}
7474

src/main/resources/templates/scala-lang/scalaClassGraphqlType.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ object ${className} {
9595
<#if fields?has_content>
9696
<#list fields as field>
9797
<#if field.javaDoc?has_content>
98-
/**
98+
/**
9999
<#list field.javaDoc as javaDocLine>
100-
* ${javaDocLine}
100+
* ${javaDocLine}
101101
</#list>
102-
*/
102+
*/
103103
</#if>
104104
<#if field.deprecated>
105105
@Deprecated

src/test/resources/expected-classes/scala/AddLabelsToLabelableMutationRequest.scala.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AddLabelsToLabelableMutationRequest extends GraphQLOperationRequest {
2020
this.alias = alias
2121
}
2222

23-
def setInput(input: AddLabelsToLabelableInput ): Unit = {
23+
def setInput(input: AddLabelsToLabelableInput): Unit = {
2424
this.input.put("input", input)
2525
}
2626

src/test/resources/expected-classes/scala/SearchResultItemConnectionResponseProjection.scala.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SearchResultItemConnectionResponseProjection extends GraphQLResponseProjec
4646
this
4747
}
4848

49-
def edges(subProjection: SearchResultItemEdgeResponseProjection ): SearchResultItemConnectionResponseProjection = {
49+
def edges(subProjection: SearchResultItemEdgeResponseProjection): SearchResultItemConnectionResponseProjection = {
5050
edges(null.asInstanceOf[String], subProjection)
5151
}
5252

@@ -64,7 +64,7 @@ class SearchResultItemConnectionResponseProjection extends GraphQLResponseProjec
6464
this
6565
}
6666

67-
def nodes(subProjection: SearchResultItemResponseProjection ): SearchResultItemConnectionResponseProjection = {
67+
def nodes(subProjection: SearchResultItemResponseProjection): SearchResultItemConnectionResponseProjection = {
6868
nodes(null.asInstanceOf[String], subProjection)
6969
}
7070

@@ -73,7 +73,7 @@ class SearchResultItemConnectionResponseProjection extends GraphQLResponseProjec
7373
this
7474
}
7575

76-
def pageInfo(subProjection: PageInfoResponseProjection ): SearchResultItemConnectionResponseProjection = {
76+
def pageInfo(subProjection: PageInfoResponseProjection): SearchResultItemConnectionResponseProjection = {
7777
pageInfo(null.asInstanceOf[String], subProjection)
7878
}
7979

src/test/resources/expected-classes/scala/SearchResultItemResponseProjection.scala.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
2020
this
2121
}
2222

23-
def onApp(subProjection: AppResponseProjection ): SearchResultItemResponseProjection = {
23+
def onApp(subProjection: AppResponseProjection): SearchResultItemResponseProjection = {
2424
onApp(null.asInstanceOf[String], subProjection)
2525
}
2626

@@ -29,7 +29,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
2929
this
3030
}
3131

32-
def onRepository(subProjection: RepositoryResponseProjection ): SearchResultItemResponseProjection = {
32+
def onRepository(subProjection: RepositoryResponseProjection): SearchResultItemResponseProjection = {
3333
onRepository(null.asInstanceOf[String], subProjection)
3434
}
3535

@@ -38,7 +38,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
3838
this
3939
}
4040

41-
def onIssue(subProjection: IssueResponseProjection ): SearchResultItemResponseProjection = {
41+
def onIssue(subProjection: IssueResponseProjection): SearchResultItemResponseProjection = {
4242
onIssue(null.asInstanceOf[String], subProjection)
4343
}
4444

@@ -47,7 +47,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
4747
this
4848
}
4949

50-
def onOrganization(subProjection: OrganizationResponseProjection ): SearchResultItemResponseProjection = {
50+
def onOrganization(subProjection: OrganizationResponseProjection): SearchResultItemResponseProjection = {
5151
onOrganization(null.asInstanceOf[String], subProjection)
5252
}
5353

@@ -56,7 +56,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
5656
this
5757
}
5858

59-
def onUser(subProjection: UserResponseProjection ): SearchResultItemResponseProjection = {
59+
def onUser(subProjection: UserResponseProjection): SearchResultItemResponseProjection = {
6060
onUser(null.asInstanceOf[String], subProjection)
6161
}
6262

@@ -65,7 +65,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
6565
this
6666
}
6767

68-
def onMarketplaceListing(subProjection: MarketplaceListingResponseProjection ): SearchResultItemResponseProjection = {
68+
def onMarketplaceListing(subProjection: MarketplaceListingResponseProjection): SearchResultItemResponseProjection = {
6969
onMarketplaceListing(null.asInstanceOf[String], subProjection)
7070
}
7171

@@ -74,7 +74,7 @@ class SearchResultItemResponseProjection extends GraphQLResponseProjection {
7474
this
7575
}
7676

77-
def onPullRequest(subProjection: PullRequestResponseProjection ): SearchResultItemResponseProjection = {
77+
def onPullRequest(subProjection: PullRequestResponseProjection): SearchResultItemResponseProjection = {
7878
onPullRequest(null.asInstanceOf[String], subProjection)
7979
}
8080

src/test/resources/expected-classes/scala/builder/CaseQueryRequest.scala.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CaseQueryRequest extends GraphQLOperationRequest {
2020
this.alias = alias
2121
}
2222

23-
def setFinal(Final: Seq[Char] ): Unit = {
23+
def setFinal(Final: Seq[Char]): Unit = {
2424
this.input.put("final", Final)
2525
}
2626

src/test/resources/expected-classes/scala/extend/request/EventResponseProjection.scala.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class EventResponseProjection extends GraphQLResponseProjection {
4343
this
4444
}
4545

46-
def assets(subProjection: AssetResponseProjection ): EventResponseProjection = {
46+
def assets(subProjection: AssetResponseProjection): EventResponseProjection = {
4747
assets(null.asInstanceOf[String], subProjection)
4848
}
4949

0 commit comments

Comments
 (0)