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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,6 @@ pubspec.lock
# Python cache
__pycache__/
*.pyc

# Claude working files
/.claude/worktrees/
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Agent Guidelines
Please read and follow all guidelines in the project's agent documentation:

- Start with the table of contents: `./agents/_TOC.md`.
- Start with the table of contents: `.agents/_TOC.md`.
- Follow all linked documents from the TOC.
- Apply all coding standards, formatting rules, and project conventions found in these documents.

Expand Down
16 changes: 15 additions & 1 deletion base/src/main/kotlin/io/spine/string/TemplateStringExts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,21 @@ public fun TemplateString.requireComplete(
}
}

private fun Iterable<Placeholder>.joinQuoted(): String =
/**
* Joins all placeholders in this iterable into a single string,
* separating them with commas and wrapping each placeholder name in backticks.
*
* This is a convenience method for formatting lists of placeholders
* in error messages and diagnostic output.
*
* For example, given placeholders with names `"foo"`, `"bar"`, and `"baz"`,
* this method returns:
* ```
* `foo`, `bar`, `baz`.
* ```
* @return A comma-separated string of quoted placeholder names.
*/
public fun Iterable<Placeholder>.joinQuoted(): String =
joinToString { it.quoted }
Comment thread
alexander-yevsyukov marked this conversation as resolved.

/**
Expand Down
30 changes: 30 additions & 0 deletions base/src/test/kotlin/io/spine/string/TemplateStringExtsSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,36 @@ internal class TemplateStringExtsSpec {
}
}

@Nested inner class
`join placeholders into a quoted, comma-separated string` {

@Test
fun `wrapping each name in backticks and separating with a comma and a space`() {
val placeholders = listOf(Placeholder("foo"), Placeholder("bar"), Placeholder("baz"))
placeholders.joinQuoted() shouldBe "`foo`, `bar`, `baz`"
}

@Test
fun `producing a single backticked name for one element`() {
listOf(Placeholder("only")).joinQuoted() shouldBe "`only`"
}

@Test
fun `producing an empty string for an empty iterable`() {
emptyList<Placeholder>().joinQuoted() shouldBe ""
}

@Test
fun `preserving the order of elements and supporting dotted or underscored names`() {
val placeholders = listOf(
Placeholder("my.key"),
Placeholder("my_key"),
Placeholder("myKey"),
)
placeholders.joinQuoted() shouldBe "`my.key`, `my_key`, `myKey`"
}
}

@Test
fun `format with missing placeholders`() {
val template = templateString {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ package io.spine.dependency.local
object CoreJvmCompiler {

/**
* The Compiler belongs the `tools` group.
* The Compiler belongs to the `tools` group.
*/
const val group = Spine.toolsGroup

Expand All @@ -51,7 +51,7 @@ object CoreJvmCompiler {
/**
* The version to be used for integration tests.
*/
const val version = "2.0.0-SNAPSHOT.062"
const val version = "2.0.0-SNAPSHOT.063"

/**
* The ID of the Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class DependencyReportOutputTest {

@Test
fun `write the generated POM under docs-dependencies`() {
projectDir.resolve("pom.xml").writeText("legacy POM")

PomGenerator.applyTo(project)

project.tasks.named("generatePom").get()
Expand All @@ -70,8 +68,6 @@ class DependencyReportOutputTest {

@Test
fun `merge license reports under docs-dependencies`() {
projectDir.resolve("dependencies.md").writeText("legacy report")

project.pluginManager.apply(BasePlugin::class.java)
val subproject = subproject("sub")
LicenseReporter.generateReportIn(subproject)
Expand Down
16 changes: 8 additions & 8 deletions docs/dependencies/dependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


# Dependencies of `io.spine:spine-annotations:2.0.0-SNAPSHOT.388`
# Dependencies of `io.spine:spine-annotations:2.0.0-SNAPSHOT.389`

## Runtime
1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 26.0.2.
Expand Down Expand Up @@ -764,14 +764,14 @@

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Fri May 15 21:01:29 WEST 2026** using
This report was generated on **Fri May 15 22:53:38 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-base:2.0.0-SNAPSHOT.388`
# Dependencies of `io.spine:spine-base:2.0.0-SNAPSHOT.389`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -1616,14 +1616,14 @@ This report was generated on **Fri May 15 21:01:29 WEST 2026** using

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Fri May 15 21:01:29 WEST 2026** using
This report was generated on **Fri May 15 22:53:38 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-environment:2.0.0-SNAPSHOT.388`
# Dependencies of `io.spine:spine-environment:2.0.0-SNAPSHOT.389`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -2446,14 +2446,14 @@ This report was generated on **Fri May 15 21:01:29 WEST 2026** using

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Fri May 15 21:01:29 WEST 2026** using
This report was generated on **Fri May 15 22:53:38 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-format:2.0.0-SNAPSHOT.388`
# Dependencies of `io.spine:spine-format:2.0.0-SNAPSHOT.389`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0.
Expand Down Expand Up @@ -3356,6 +3356,6 @@ This report was generated on **Fri May 15 21:01:29 WEST 2026** using

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Fri May 15 21:01:29 WEST 2026** using
This report was generated on **Fri May 15 22:53:38 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
2 changes: 1 addition & 1 deletion docs/dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject.
-->
<groupId>io.spine</groupId>
<artifactId>base-libraries</artifactId>
<version>2.0.0-SNAPSHOT.388</version>
<version>2.0.0-SNAPSHOT.389</version>

<inceptionYear>2015</inceptionYear>

Expand Down
2 changes: 1 addition & 1 deletion version.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

val versionToPublish: String by extra("2.0.0-SNAPSHOT.388")
val versionToPublish: String by extra("2.0.0-SNAPSHOT.389")
Loading