Skip to content

Commit ac45415

Browse files
author
yevhenii-nadtochii
committed
Make concatenated strings begin with whitespace
1 parent 4a049a9 commit ac45415

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

java-tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationITest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ private fun Builder.assertConstraintViolation(
108108

109109
@Suppress("UNUSED_PARAMETER") // The function should match the expected interface.
110110
private fun defaultTemplate(fieldNumber: Int) =
111-
"The field `\${goes.companion}` must also be set when `\${field.path}` " +
112-
"is set in `\${parent.type}`."
111+
"The field `\${goes.companion}` must also be set when `\${field.path}`" +
112+
" is set in `\${parent.type}`."
113113

114114
private fun customTemplate(fieldNumber: Int) =
115115
"Field_$fieldNumber: `{companionName}`, `{fieldName}`."

java-tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationITest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ private fun <T : Any> Builder.assertConstraintViolation(
114114

115115
@Suppress("UNUSED_PARAMETER") // The function should match the expected interface.
116116
private fun defaultTemplate(fieldNumber: Int) =
117-
"The field `\${parent.type}.\${field.path}` of the type `\${field.type}` already has " +
118-
"the value `\${field.value}` and cannot be reassigned to `\${field.proposed_value}`."
117+
"The field `\${parent.type}.\${field.path}` of the type `\${field.type}` already has" +
118+
" the value `\${field.value}` and cannot be reassigned to `\${field.proposed_value}`."
119119

120120
private fun customTemplate(fieldNumber: Int) =
121-
"Field_$fieldNumber: " +
122-
"`\${field.value}`, `\${field.path}`, `\${field.proposed_value}`, `\${field.type}`."
121+
"Field_$fieldNumber:" +
122+
" `\${field.value}`, `\${field.path}`, `\${field.proposed_value}`, `\${field.type}`."

java/src/main/kotlin/io/spine/validation/java/FieldValues.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ internal fun FieldType.stringValueOf(value: Expression<*>): Expression<String> =
6666
isMessage || isEnum -> value.stringify()
6767
isPrimitive -> value.stringifyPrimitive(primitive)
6868
else -> error(
69-
"Cannot convert `$value` expression to `String` expression. " +
70-
"Unsupported field type: `${name}`."
69+
"Cannot convert `$value` expression to `String` expression." +
70+
" Unsupported field type: `${name}`."
7171
)
7272
}
7373
isList || isMap -> value.stringify()
7474
else -> error(
75-
"Cannot convert `$value` expression to `String` expression. " +
76-
"Unsupported field type: `${name}`."
75+
"Cannot convert `$value` expression to `String` expression." +
76+
" Unsupported field type: `${name}`."
7777
)
7878
}
7979

model/src/main/kotlin/io/spine/validation/GoesPolicy.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,27 @@ internal class GoesPolicy : Policy<FieldOptionDiscovered>() {
9696

9797
private fun checkFieldType(field: Field, file: File) =
9898
Compilation.check(field.type.isSupported(), file, field.span) {
99-
"The field type `${field.type}` of the `${field.qualifiedName}` field " +
100-
"is not supported by the `($GOES)` option."
99+
"The field type `${field.type}` of the `${field.qualifiedName}` field" +
100+
" is not supported by the `($GOES)` option."
101101
}
102102

103103
private fun checkCompanionType(companion: Field, file: File) =
104104
Compilation.check(companion.type.isSupported(), file, companion.span) {
105-
"The field type `${companion.type}` of the companion `${companion.qualifiedName}` field " +
106-
"is not supported by the `($GOES)` option."
105+
"The field type `${companion.type}` of the companion `${companion.qualifiedName}` field" +
106+
" is not supported by the `($GOES)` option."
107107
}
108108

109109
private fun checkFieldExists(message: MessageType, companion: String, field: Field, file: File) =
110110
Compilation.check(message.findField(companion) != null, file, field.span) {
111-
"The message `${message.name.qualifiedName}` does not have `$companion` field " +
112-
"declared as companion of `${field.name.value}` by the `($GOES)` option."
111+
"The message `${message.name.qualifiedName}` does not have `$companion` field" +
112+
" declared as companion of `${field.name.value}` by the `($GOES)` option."
113113
}
114114

115115
private fun checkFieldsDistinct(field: Field, companion: Field, file: File) =
116116
Compilation.check(field != companion, file, field.span) {
117-
"The `($GOES)` option cannot use the marked field as its own companion. " +
118-
"Self-referencing is prohibited. Please specify another field. " +
119-
"The invalid field: `${field.qualifiedName}`."
117+
"The `($GOES)` option cannot use the marked field as its own companion." +
118+
" Self-referencing is prohibited. Please specify another field." +
119+
" The invalid field: `${field.qualifiedName}`."
120120
}
121121

122122
private fun FieldType.isSupported(): Boolean =

model/src/main/kotlin/io/spine/validation/PatternPolicy.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ internal class PatternPolicy : Policy<FieldOptionDiscovered>() {
8080

8181
private fun checkFieldType(field: Field, file: File) =
8282
Compilation.check(field.type.isSupported(), file, field.span) {
83-
"The field type `${field.type}` of `${field.qualifiedName}` is not supported " +
84-
"by the `($PATTERN)` option. Supported field types: strings and repeated " +
85-
"of strings."
83+
"The field type `${field.type}` of `${field.qualifiedName}` is not supported" +
84+
" by the `($PATTERN)` option. Supported field types: strings and repeated" +
85+
" of strings."
8686
}
8787

8888
private fun FieldType.isSupported(): Boolean = isSingularString || isRepeatedString

model/src/main/kotlin/io/spine/validation/required/RequiredPolicy.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ internal class RequiredPolicy : Policy<FieldOptionDiscovered>() {
101101

102102
private fun checkFieldType(field: Field, file: File) =
103103
Compilation.check(field.type.isSupported(), file, field.span) {
104-
"The field type `${field.type}` of `${field.qualifiedName}` is not supported " +
105-
"by the `($REQUIRED)` option. Supported field types: messages, enums, " +
106-
"strings, bytes, repeated, and maps."
104+
"The field type `${field.type}` of `${field.qualifiedName}` is not supported" +
105+
" by the `($REQUIRED)` option. Supported field types: messages, enums," +
106+
" strings, bytes, repeated, and maps."
107107
}
108108

109109
private fun FieldType.isSupported(): Boolean =

model/src/test/kotlin/io/spine/validation/GoesPolicySpec.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ internal class GoesPolicySpec : CompilationErrorTest() {
7777
}
7878

7979
private fun unsupportedFieldType(field: Field) =
80-
"The field type `${field.type}` of the `${field.qualifiedName}` field " +
81-
"is not supported by the `($GOES)` option."
80+
"The field type `${field.type}` of the `${field.qualifiedName}` field" +
81+
" is not supported by the `($GOES)` option."
8282

8383
private fun unsupportedCompanionType(field: Field) =
84-
"The field type `${field.type}` of the companion `${field.qualifiedName}` field " +
85-
"is not supported by the `($GOES)` option."
84+
"The field type `${field.type}` of the companion `${field.qualifiedName}` field" +
85+
" is not supported by the `($GOES)` option."
8686

8787
private fun nonExistingCompanion(message: Descriptor, companionName: String) =
88-
"The message `${message.fullName}` does not have `$companionName` field " +
89-
"declared as companion of `target` by the `($GOES)` option."
88+
"The message `${message.fullName}` does not have `$companionName` field" +
89+
" declared as companion of `target` by the `($GOES)` option."
9090

9191
private fun selfCompanion(field: Field) =
92-
"The `($GOES)` option cannot use the marked field as its own companion. " +
93-
"Self-referencing is prohibited. Please specify another field. " +
94-
"The invalid field: `${field.qualifiedName}`."
92+
"The `($GOES)` option cannot use the marked field as its own companion." +
93+
" Self-referencing is prohibited. Please specify another field." +
94+
" The invalid field: `${field.qualifiedName}`."

model/src/test/kotlin/io/spine/validation/RequiredPolicySpec.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ internal class RequiredPolicySpec : CompilationErrorTest() {
7474
}
7575

7676
private fun unsupportedFieldType(field: Field) =
77-
"The field type `${field.type}` of `${field.qualifiedName}` is not supported " +
78-
"by the `($REQUIRED)` option."
77+
"The field type `${field.type}` of `${field.qualifiedName}` is not supported" +
78+
" by the `($REQUIRED)` option."

0 commit comments

Comments
 (0)