Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.openapitools.codegen.languages;

import io.swagger.v3.oas.models.Operation;
Expand Down Expand Up @@ -155,7 +171,8 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("jsonSupport.mustache", invokerFolder, "JsonSupport.scala"));
supportingFiles.add(new SupportingFile("additionalTypeSerializers.mustache", invokerFolder, "AdditionalTypeSerializers.scala"));
supportingFiles.add(new SupportingFile("project/build.properties.mustache", "project", "build.properties"));
supportingFiles.add(new SupportingFile("dateSerializers.mustache", invokerFolder, "DateSerializers.scala"));
supportingFiles.add(new SupportingFile("project/plugins.mustache", "project", "plugins.sbt"));
supportingFiles.add(new SupportingFile("scalafmt.mustache", "", ".scalafmt.conf"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.6")
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version=3.10.6
runner.dialect = scala213
project {
git = false
excludeFilters = [
scalafmt-benchmarks/src/resources,
sbt-test
bin/issue
]
layout = StandardConvention
}
align {
preset = none
stripMargin = true
}
binPack {
importSelectors = fold
}
newlines {
avoidForSimpleOverflow = all
ignoreInSyntax = false
source = fold
}
rewrite {
rules = [
AvoidInfix,
Imports,
RedundantBraces,
RedundantParens,
SortModifiers,
]
imports {
selectors = fold
removeRedundantSelectors = true
sort = ascii
groups = [
["org\\.scalafmt\\..*"],
["scala\\.meta\\..*", "org\\.scalameta\\..*"],
["sbt\\..*"],
["java.?\\..*"],
["scala\\..*"],
["org\\..*"],
["com\\..*"],
]
}
redundantBraces {
preset = all
oneStatApply {
parensMaxSpan = 300
bracesMinSpan = 300
}
}
redundantParens {
preset = all
}
sortModifiers.preset = styleGuide
trailingCommas.style = "always"
}
3 changes: 2 additions & 1 deletion samples/client/petstore/scala-sttp4/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.scalafmt.conf
README.md
build.sbt
project/build.properties
project/plugins.sbt
src/main/scala/org/openapitools/client/api/PetApi.scala
src/main/scala/org/openapitools/client/api/StoreApi.scala
src/main/scala/org/openapitools/client/api/UserApi.scala
src/main/scala/org/openapitools/client/core/AdditionalTypeSerializers.scala
src/main/scala/org/openapitools/client/core/DateSerializers.scala
src/main/scala/org/openapitools/client/core/JsonSupport.scala
src/main/scala/org/openapitools/client/model/ApiResponse.scala
src/main/scala/org/openapitools/client/model/Category.scala
Expand Down
58 changes: 58 additions & 0 deletions samples/client/petstore/scala-sttp4/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version=3.10.6
runner.dialect = scala213
project {
git = false
excludeFilters = [
scalafmt-benchmarks/src/resources,
sbt-test
bin/issue
]
layout = StandardConvention
}
align {
preset = none
stripMargin = true
}
binPack {
importSelectors = fold
}
newlines {
avoidForSimpleOverflow = all
ignoreInSyntax = false
source = fold
}
rewrite {
rules = [
AvoidInfix,
Imports,
RedundantBraces,
RedundantParens,
SortModifiers,
]
imports {
selectors = fold
removeRedundantSelectors = true
sort = ascii
groups = [
["org\\.scalafmt\\..*"],
["scala\\.meta\\..*", "org\\.scalameta\\..*"],
["sbt\\..*"],
["java.?\\..*"],
["scala\\..*"],
["org\\..*"],
["com\\..*"],
]
}
redundantBraces {
preset = all
oneStatApply {
parensMaxSpan = 300
bracesMinSpan = 300
}
}
redundantParens {
preset = all
}
sortModifiers.preset = styleGuide
trailingCommas.style = "always"
}
1 change: 1 addition & 0 deletions samples/client/petstore/scala-sttp4/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.6")
Loading