diff --git a/.agents/memory/MEMORY.md b/.agents/memory/MEMORY.md index b562ccee24..bb212a41bc 100644 --- a/.agents/memory/MEMORY.md +++ b/.agents/memory/MEMORY.md @@ -9,7 +9,6 @@ See [README.md](README.md) for the format and routing rules. ## Project (durable context & rationale) -- [which-fixer applied](which-fixer-applied.md) — bulk sweep done; skill now runs in incremental mode - [integration tests stale compiler after version bump](project/integration-tests-stale-compiler-after-version-bump.md) — after a version bump, clean-build `integrationTest` or it may launch the old compiler - [functional-test fixtures](project/functional-test-fixtures.md) — authoring `gradle-plugin` TestKit fixtures: copied buildSrc, import rules, Maven Local prerequisite, `tuneRunner()` diff --git a/.agents/memory/reference/cache-warm-window.md b/.agents/memory/reference/cache-warm-window.md index 796dd4d303..b57ca218cb 100644 --- a/.agents/memory/reference/cache-warm-window.md +++ b/.agents/memory/reference/cache-warm-window.md @@ -18,7 +18,7 @@ same cache slot — provided they fall within the TTL. Developers must have `ENABLE_PROMPT_CACHING_1H=1` set, otherwise the window is too short for cross-session hits to occur reliably. This setting will work ONLY for Claude Code which runs the CLI binary. -It will not work for JetBrains Air or any other IDE plugin which does not +It will not work for JetBrains Air or any other IDE plugin that does not run the Claude Code CLI binary. **Cache is per Anthropic workspace.** All developers authenticated via the diff --git a/.agents/memory/which-fixer-applied.md b/.agents/memory/which-fixer-applied.md deleted file mode 100644 index ccf5f71c78..0000000000 --- a/.agents/memory/which-fixer-applied.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: which-fixer-applied -description: Records that the which-fixer bulk sweep was completed for this repo. -metadata: - type: project ---- - -Bulk `which-fixer` sweep completed. - -**Why:** Marks the transition from bulk to incremental mode so future -invocations only scan files modified on the current branch. - -**How to apply:** The `which-fixer` skill reads this file on every -invocation. When it exists, the skill runs in incremental mode. diff --git a/.claude/settings.json b/.claude/settings.json index 357650cf71..3c7da68c35 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,5 +1,6 @@ { "$schema": "https://json.schemastore.org/claude-code-settings.json", + "plansDirectory": ".claude/plans", "permissions": { "allow": [ "Edit(version.gradle.kts)", @@ -32,8 +33,11 @@ "Bash(mkdir:*)", "Bash(touch:*)", "Bash(python3 .agents/skills/update-copyright/scripts/update_copyright.py:*)", + "Bash(.agents/skills/version-bumped/scripts/version-bumped.sh)", "Bash(./config/pull)", - "Bash(./config/migrate)" + "Bash(./config/migrate)", + "Skill(pre-pr)", + "Skill(pre-pr:*)" ], "deny": [ "Bash(git reset --hard:*)", diff --git a/.gitignore b/.gitignore index dfb4774d4e..ed1b0baa78 100644 --- a/.gitignore +++ b/.gitignore @@ -54,8 +54,12 @@ .idea/modules .idea/shelf +# `.idea/misc.xml` is intentionally NOT re-included below. It is project-local — +# it holds the per-project JDK name and IDEA's own churn (entry-point list +# indices, external-storage toggles) — so `.idea/*.xml` above keeps it ignored. +# `./config/pull` (via `migrate`) untracks any copy an earlier pull committed. + # Do not ignore the following IDEA settings -!.idea/misc.xml !.idea/codeStyleSettings.xml !.idea/codeStyles/ !.idea/copyright/ @@ -173,6 +177,12 @@ __pycache__/ # Claude working files /.claude/worktrees/ +# Ephemeral plan-mode scratch (durable task docs live in `.agents/tasks/`). +/.claude/plans/ + +# Personal, per-developer Claude Code settings overrides (never committed; +# the distributed `.claude/settings.json` is the shared, committed layer). +/.claude/settings.local.json # Auto-downloaded Lychee binary used by the `check-links` skill. /.agents/skills/check-links/.cache/ @@ -190,7 +200,6 @@ docs/_preview/resources/ # <<< shared config <<< # >>> repo-local entries (preserved across ./config/pull) >>> -!.idea/misc.xml !.idea/codeStyleSettings.xml !.idea/codeStyles/ !.idea/copyright/ diff --git a/.idea/.gitignore b/.idea/.gitignore index 73f69e0958..9838b6fff3 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,4 @@ /dataSources.local.xml # Editor-based HTTP Client requests /httpRequests/ +/misc.xml diff --git a/.idea/live-templates/README.md b/.idea/live-templates/README.md index 950066731a..267008ad12 100644 --- a/.idea/live-templates/README.md +++ b/.idea/live-templates/README.md @@ -22,6 +22,6 @@ In order to add these templates, perform the following steps: 1. Open the corresponding template: `Preferences -> Editor -> Live Templates -> User.todo`. 2. Click on `Edit variables`. -3. Set `USER` variable to your domain email address without `@teamdev.com` ending. For example, +3. Set `USER` variable to your domain email address without `@teamdev.com` ending. For example, for `jack.sparrow@teamdev.com` use the following expression `"jack.sparrow"`. 4. Verify that the template generates expected comments: `// TODO:2022-11-03:jack.sparrow: <...>`. diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 264f823015..0000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2185ef6d5e..896546ae01 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,12 +21,12 @@ Code contributions should: Contributor License Agreement ----------------------------- Contributions to the code of Spine Event Engine framework and its libraries must be accompanied by -Contributor License Agreement (CLA). +a Contributor License Agreement (CLA). * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an individual CLA. - * If you work for a company which wants you to contribute your work, + * If you work for a company that wants you to contribute your work, then an authorized person from your company will need to sign a corporate CLA. Please [contact us][legal-email] for arranging the paper formalities. diff --git a/api-tests/src/test/kotlin/io/spine/tools/compiler/context/MemberSpec.kt b/api-tests/src/test/kotlin/io/spine/tools/compiler/context/MemberSpec.kt index c7eff1a911..710941607d 100644 --- a/api-tests/src/test/kotlin/io/spine/tools/compiler/context/MemberSpec.kt +++ b/api-tests/src/test/kotlin/io/spine/tools/compiler/context/MemberSpec.kt @@ -67,8 +67,8 @@ internal class MemberSpec { /** * Creates and runs a pipeline with [ProbeRenderer]. * - * Java language is used in the pipeline for simplicity of the setup - * assisted by ProtoTap Gradle plugin. + * The Java language is used in the pipeline for simplicity of the setup + * assisted by the ProtoTap Gradle plugin. * * No Java codegen features are checked by this test suite. */ @@ -160,7 +160,7 @@ internal class MemberSpec { } /** - * A diagnostic probe that performs queries as a [Member] of code generation process, + * A diagnostic probe that performs queries as a [Member] of the code generation process, * but does not render anything. */ class ProbeRenderer : Renderer(Java) { diff --git a/api/src/main/kotlin/io/spine/tools/compiler/Compilation.kt b/api/src/main/kotlin/io/spine/tools/compiler/Compilation.kt index 0ddeda571c..d8314598b1 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/Compilation.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/Compilation.kt @@ -48,7 +48,7 @@ import io.spine.tools.compiler.ast.File as PFile * In the production mode, the [error] method prints an error message to [System.err] and * exits the process with [ERROR_EXIT_CODE]. * - * In the testing mode, the [error] method throws [Compilation.Error] exception with + * In the testing mode, the [error] method throws a [Compilation.Error] exception with * the same error message as printed to the console in the production mode. * * The execution mode is [detected][Tests.enabled] via the [Tests] environment type. @@ -89,7 +89,7 @@ public object Compilation { * The termination of the compilation in the production mode is done by * exiting the process with [ERROR_EXIT_CODE]. * - * If the code is run [under tests][Tests] the method throws [Compilation.Error]. + * If the code is run [under tests][Tests], the method throws [Compilation.Error]. * * @param file The file in which the error occurred. * @param line The one-based number of the line with the error. @@ -114,7 +114,7 @@ public object Compilation { * The termination of the compilation in the production mode is done by * exiting the process with [ERROR_EXIT_CODE]. * - * If the code is run [under tests][Tests] the method throws [Compilation.Error]. + * If the code is run [under tests][Tests], the method throws [Compilation.Error]. * * @param file The file in which the error occurred. * @param line The one-based number of the line with the error. @@ -131,7 +131,7 @@ public object Compilation { * The termination of the compilation in the production mode is done by * exiting the process with [ERROR_EXIT_CODE]. * - * If the code is run [under tests][Tests] the method throws [Compilation.Error]. + * If the code is run [under tests][Tests], the method throws [Compilation.Error]. * * @param file The file in which the error occurred. * @param span The span of the Protobuf declaration that caused the error. @@ -164,7 +164,7 @@ public object Compilation { } /** - * Prints the warning diagnostics to [System.out] + * Prints the warning diagnostics to [System.out]. * * The method returns the string printed to the console so that it could be also * put into logging output by the calling code. @@ -178,7 +178,7 @@ public object Compilation { warning(file, span.startLine, span.startColumn, message()) /** - * Prints the warning diagnostics to [System.out] + * Prints the warning diagnostics to [System.out]. * * The method returns the string printed to the console so that it could be also * put into logging output by the calling code. @@ -227,7 +227,7 @@ public object Compilation { // "+1" counts whitespace between a prefix and the file path. val indent = Indent(prefix.length + 1) - // The first line is appended to the location, each consequent line is + // The first line is appended to the location; each subsequent line is // prepended with indentation. val indentedBody = messageLines.drop(1) .indent(indent, level = 1) @@ -277,8 +277,8 @@ public fun Compilation.check(condition: Boolean, file: PFile, span: Span, messag * it could be opened in an IDE or a browser. * * If the path is relative, it is simply returned as the result of this function. - * Even though file URI could be - * [relative](https://stackoverflow.com/questions/7857416/file-uri-scheme-and-relative-files) + * Even though a file URI could be + * [relative](https://stackoverflow.com/questions/7857416/file-uri-scheme-and-relative-files), * we do not want to use this because its full path would be resolved relatively * to a user home directory or the current directory. * None of these cases represent a directory with proto files. diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/Coordinates.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/Coordinates.kt index be74923984..fb1ee22bb9 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/Coordinates.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/Coordinates.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ import io.spine.tools.compiler.util.Cache public class Coordinates private constructor(file: FileDescriptorProto) : Locations(file) { /** - * Obtains declaration coordinates the given message. + * Obtains declaration coordinates for the given message. */ public fun forMessage(d: Descriptor): Span { val path = LocationPath.fromMessage(d) @@ -54,7 +54,7 @@ public class Coordinates private constructor(file: FileDescriptorProto) : Locati } /** - * Obtains declaration coordinates the given message. + * Obtains declaration coordinates for the given message. */ public fun forField(d: FieldDescriptor): Span { val path = LocationPath.fromMessage(d.containingType).field(d) @@ -145,7 +145,7 @@ private fun Location.toSpan(): Span { if (this == Location.getDefaultInstance()) { return Span.getDefaultInstance() } - // Convert the value of the `span` field into four-elements array. + // Convert the value of the `span` field into a four-element array. val slots = if (spanCount == 3) arrayOf(getSpan(0), getSpan(1), getSpan(0), getSpan(2)) @@ -161,7 +161,7 @@ private fun Location.toSpan(): Span { } /** - * Obtains coordinates for the file this [GenericDescriptor]. + * Obtains coordinates for the file of this [GenericDescriptor]. */ internal fun GenericDescriptor.coordinates(): Coordinates { val fromResources = withSourceLines() diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldExts.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldExts.kt index 0264474166..26cafcccb3 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldExts.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldExts.kt @@ -38,7 +38,7 @@ import io.spine.type.typeName import java.io.File /** - * Obtains the type of this field as [Type] instance. + * Obtains the type of this field as a [Type] instance. * * @throws IllegalStateException If the field is a list or a map. */ @@ -54,7 +54,7 @@ public val Field.isMessage: Boolean * Shows if this field is a `map`. * * If the field is a `map`, the `Field.type` contains the type of the value, and - * the `Field.map.key_type` contains the type the map key. + * the `Field.map.key_type` contains the type of the map key. */ public val Field.isMap: Boolean get() = type.isMap @@ -62,7 +62,7 @@ public val Field.isMap: Boolean /** * Shows if this field is a list. * - * In Protobuf `repeated` keyword denotes a sequence of values for a field. + * In Protobuf the `repeated` keyword denotes a sequence of values for a field. * However, a map is also treated as a repeated field for serialization reasons. * We use the term "list" for repeated fields that are not maps. */ @@ -70,7 +70,7 @@ public val Field.isList: Boolean get() = type.isList /** - * Shows if this field repeated. + * Shows if this field is repeated. * * Can be declared in Protobuf either as a `map` or a `repeated` field. */ diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldTypeExts.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldTypeExts.kt index de714cf464..5410ecffb9 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldTypeExts.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/FieldTypeExts.kt @@ -104,7 +104,7 @@ public val FieldType.cardinality: Cardinality /** * Converts this field type to [Type]. * - * @throws IllegalStateException If this is field type is a list or a map. + * @throws IllegalStateException If this field type is a list or a map. * * @see extractType */ @@ -125,7 +125,7 @@ public fun FieldType.toType(): Type = type { * @param typeSystem The type system to be used for obtaining type information. * * @return the message type instance or `null` if this field type is not a message, - * or if it does not refer to message being a list or a map. + * or if it does not refer to a message being a list or a map. * * @see extractType * @see extractPrimitiveType diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/FilePatterns.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/FilePatterns.kt index 3960d5306d..2bacae044f 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/FilePatterns.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/FilePatterns.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import io.spine.tools.compiler.ast.FilePattern.KindCase.INFIX import io.spine.tools.compiler.ast.FilePattern.KindCase.SUFFIX /** - * Tells if this patterns matches the given [file]. + * Tells if this pattern matches the given [file]. */ public fun FilePattern.matches(file: File): Boolean { val path = file.path diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/FilesAndPaths.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/FilesAndPaths.kt index cc0cef657b..31bad1c6dd 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/FilesAndPaths.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/FilesAndPaths.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ public fun java.io.File.toDirectory(): Directory = public fun File.toPath(): Path = Path(path) /** - * Converts this [File] into [java.io] counterpart. + * Converts this [File] into a [java.io] counterpart. */ public fun File.toJava(): java.io.File = java.io.File(path) @@ -106,7 +106,7 @@ private val PB_JSON_SUFFIX: String by lazy { /** * Returns the name of this file without an extension. * - * Takes care of the special case for "pb.json" quasi-extension. + * Takes care of the special case for the "pb.json" quasi-extension. * * @see File.name */ diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/LocationPath.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/LocationPath.kt index d76de20db3..8d31f8ee68 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/LocationPath.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/LocationPath.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ import io.spine.tools.compiler.ast.LocationPath.Companion.fromService import io.spine.tools.compiler.ast.LocationPath.Companion.plus /** - * A numerical path to a location is source code. + * A numerical path to a location in source code. * * Used by the Protobuf compiler as a coordinate system for arbitrary Protobuf declarations. * diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeDependencies.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeDependencies.kt index 18d59a675f..815dde2187 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeDependencies.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeDependencies.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,12 +32,12 @@ import io.spine.tools.compiler.type.TypeSystem * Contains information about [MessageType]s on which the given [MessageType] depends either * directly through its immediate fields, or through the fields of its immediate dependencies. * - * The given [messageType] is not considered as dependency (for itself), unless it is used + * The given [messageType] is not considered as a dependency (for itself), unless it is used * recursively in one of the immediate or nested fields. * * @param messageType The type for which we collect dependencies. * @param cardinalities The cardinalities of fields taken into account when traversing the types. - * Empty set means that all fields, including `repeated` and `map` ones will be + * An empty set means that all fields, including `repeated` and `map` ones will be * taken into account when collecting types. * @param typeSystem The type system to obtain a `MessageType` by its name. */ diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeExts.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeExts.kt index 0fd4132e8a..8ddab8a3af 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeExts.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/MessageTypeExts.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,8 +45,8 @@ public fun MessageType.withAbsoluteFile(path: File): MessageType = /** * Obtains column fields of this message type. * - * @return the list if the column fields, or - * empty list if none of the fields has the `(column)` option. + * @return the list of the column fields, or + * an empty list if none of the fields has the `(column)` option. */ public val MessageType.columns: List get() = fieldList.filter { it.optionList.any { option -> option.isColumn } } diff --git a/api/src/main/kotlin/io/spine/tools/compiler/ast/TypeBase.kt b/api/src/main/kotlin/io/spine/tools/compiler/ast/TypeBase.kt index b77ef38013..0af44268ad 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/ast/TypeBase.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/ast/TypeBase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ public interface TypeBase: Message { public fun hasMessage(): Boolean /** - * A mix-in method for being implemented by the generated class,indicating whether + * A mix-in method for being implemented by the generated class, indicating whether * this type is an enum. * * @see isEnum diff --git a/api/src/main/kotlin/io/spine/tools/compiler/plugin/View.kt b/api/src/main/kotlin/io/spine/tools/compiler/plugin/View.kt index 98b9e6fa50..999747339d 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/plugin/View.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/plugin/View.kt @@ -70,7 +70,7 @@ import kotlin.reflect.KClass * [@Subscribe][io.spine.core.Subscribe]. In these methods, change the state of the view via * the `builder()`, `update { }`, or `alter { }` methods. * - * We recommend to use `internal` access for the subscriber methods in Kotlin and package-private — + * We recommend using `internal` access for the subscriber methods in Kotlin and package-private — * in Java. The methods are not `private`, as they are invoked by the framework, and not `public`, * as they must not be called directly. * diff --git a/api/src/main/kotlin/io/spine/tools/compiler/protobuf/DescriptorExts.kt b/api/src/main/kotlin/io/spine/tools/compiler/protobuf/DescriptorExts.kt index e3d9ae08c0..58d663f973 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/protobuf/DescriptorExts.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/protobuf/DescriptorExts.kt @@ -135,7 +135,7 @@ internal fun buildTypeName( } /** - * Produces a sequence by walking through all the nested message definitions staring with [type]. + * Produces a sequence by walking through all the nested message definitions starting with [type]. * * @param type The message definition that may contain a nested message definition * to walk through. diff --git a/api/src/main/kotlin/io/spine/tools/compiler/protobuf/FieldDescriptorExts.kt b/api/src/main/kotlin/io/spine/tools/compiler/protobuf/FieldDescriptorExts.kt index 3184fb304c..89fc1483fd 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/protobuf/FieldDescriptorExts.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/protobuf/FieldDescriptorExts.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -126,7 +126,7 @@ private fun message(field: FieldDescriptor): Type = type { /** * Converts this field type into an instance of [PrimitiveType], or - * `null` if the type is not primitive + * `null` if the type is not primitive. */ @Suppress("CyclomaticComplexMethod") public fun FieldDescriptor.Type.toPrimitiveType(): PrimitiveType? = when (this) { diff --git a/api/src/main/kotlin/io/spine/tools/compiler/render/InsertionPoint.kt b/api/src/main/kotlin/io/spine/tools/compiler/render/InsertionPoint.kt index 106c2cf3cd..86c78abbc2 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/render/InsertionPoint.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/render/InsertionPoint.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -142,7 +142,7 @@ public val InsertionPoint.codeLine: String * The user is responsible for ensuring that the insertion point exists and * the label is spelled correctly. * - * [InsertionPointPrinter]s will never add such a point to exising code. + * [InsertionPointPrinter]s will never add such a point to existing code. * However, if Protoc generates one, the users may base their code generation on it. * * @property label The name of the insertion point. Typically, starts with the identifier of diff --git a/api/src/main/kotlin/io/spine/tools/compiler/render/SourceAtLine.kt b/api/src/main/kotlin/io/spine/tools/compiler/render/SourceAtLine.kt index c6c29a212b..b599c7d571 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/render/SourceAtLine.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/render/SourceAtLine.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import io.spine.annotation.VisibleForTesting import io.spine.string.Indent import io.spine.string.Indent.Companion.DEFAULT_JAVA_INDENT_SIZE import io.spine.string.Separator -import io.spine.string.atLevel /** * A fluent builder for inserting code into pre-prepared insertion points. @@ -47,7 +46,7 @@ internal constructor( private var indentLevel: Int = 0 /** - * Specifies extra indentation to be added to inserted code lines + * Specifies extra indentation to be added to inserted code lines. * * Each unit adds the number of spaces specified by the [indent] property. */ diff --git a/api/src/main/kotlin/io/spine/tools/compiler/settings/SettingsDirectory.kt b/api/src/main/kotlin/io/spine/tools/compiler/settings/SettingsDirectory.kt index 09c266b239..6f424aac43 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/settings/SettingsDirectory.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/settings/SettingsDirectory.kt @@ -42,7 +42,7 @@ import kotlin.io.path.listDirectoryEntries * * Only the files with the [recognized extensions][Format] are considered settings files. * - * Only the files belonging to the directory directly are considered, + * Only the files belonging to the directory directly are considered; * no subdirectories are traversed. * * This class works in combination with the view that manages the [Settings] state class diff --git a/api/src/main/kotlin/io/spine/tools/compiler/settings/WithSettings.kt b/api/src/main/kotlin/io/spine/tools/compiler/settings/WithSettings.kt index 1b1f50d363..d90b4af206 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/settings/WithSettings.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/settings/WithSettings.kt @@ -45,7 +45,7 @@ package io.spine.tools.compiler.settings * Jackson is capable of working with Kotlin `val`-s, so the data class can be immutable. * In Java, Jackson is capable of working with immutable types as well. * However, it may require some annotations to be added to the class. - * Please see the Jackson's documentation for more info. + * Please see Jackson's documentation for more info. */ public interface WithSettings { diff --git a/api/src/main/kotlin/io/spine/tools/compiler/value/Values.kt b/api/src/main/kotlin/io/spine/tools/compiler/value/Values.kt index bd3c59b7c5..587c3d726a 100644 --- a/api/src/main/kotlin/io/spine/tools/compiler/value/Values.kt +++ b/api/src/main/kotlin/io/spine/tools/compiler/value/Values.kt @@ -78,7 +78,7 @@ private fun FieldDescriptor.toValue(raw: Any): Value = when { } /** - * Converts the given [raw] value into an instace of [Value] by taking type + * Converts the given [raw] value into an instance of [Value] by taking type * information from this [FieldDescriptor]. * * @see com.google.protobuf.Descriptors.FieldDescriptor.JavaType diff --git a/api/src/main/proto/spine/compiler/actions.proto b/api/src/main/proto/spine/compiler/actions.proto index e0a982d20d..18eb68703d 100644 --- a/api/src/main/proto/spine/compiler/actions.proto +++ b/api/src/main/proto/spine/compiler/actions.proto @@ -39,14 +39,14 @@ import "google/protobuf/any.proto"; // A collection of code generation actions associated with the parameters passed to these actions. // -// Some code generation scenarios may be solved by applying combination of render actions. +// Some code generation scenarios may be solved by applying a combination of render actions. // For example, we want to make messages declared in proto files named `command.proto` // implement the `CommandMessage` interface, and messages declared in files named `event.proto` // implement the `EventMessage` interface. Implementation will involve the following steps: // // 1) Create a render action called `ImplementInterface`. The action would accept the name // of the interface as the parameter. -// 2) Create Protobuf type for settings that would match a file pattern with the action and +// 2) Create a Protobuf type for settings that would match a file pattern with the action and // the corresponding parameter with the name of the interface. // 3) Create a Compiler plugin with a renderer that would load the settings and // run corresponding actions. @@ -70,7 +70,7 @@ message Actions { // The types, names of which come as the keys in the map, must serve the same // programming language and the same type of Protobuf declaration. // The instances of actions are created reflectively. If the above rule is not - // followed a runtime action will occur during creation of an action. + // followed, a runtime action will occur during creation of an action. // // The type of the parameter wrapped into `Any` must match the type of // the parameter accepted by the action. Otherwise, a runtime error will occur. diff --git a/api/src/main/proto/spine/compiler/ast.proto b/api/src/main/proto/spine/compiler/ast.proto index fa041370f1..3e3c2a4e5a 100644 --- a/api/src/main/proto/spine/compiler/ast.proto +++ b/api/src/main/proto/spine/compiler/ast.proto @@ -87,7 +87,7 @@ message MessageType { // Name of the message type that hosts the declaration of this type. // - // This field is empty for the top level message type. + // This field is empty for the top-level message type. // TypeName declared_in = 3; @@ -150,7 +150,7 @@ message EnumType { // Name of the message type that hosts the declaration of this type. // - // This field is empty for the top level enum. + // This field is empty for the top-level enum. // TypeName declared_in = 5; @@ -277,7 +277,7 @@ message FieldName { string value = 1 [(required) = true]; } -// A cardinality of values stored a field. +// A cardinality of values stored in a field. enum Cardinality { CARDINALITY_UNDEFINED = 0; @@ -304,7 +304,7 @@ message Field { // The field number. // - // Not to be confused with the field's order to declaration. + // Not to be confused with the field's order of declaration. // // For example, in a message: // ``` @@ -415,7 +415,7 @@ message ServiceName { // A type URL has the following structure: "/.". // For more info, see the definition of `google.protobuf.Any.type_url`. // - // Must not include a training slash ("/"). + // Must not include a trailing slash ("/"). // string type_url_prefix = 3 [(pattern).regex = "^.*[^/]$"]; } @@ -579,7 +579,7 @@ message Span { // The line where the declaration ends. // - // Contains the same value as `start_line` for one line declarations. + // Contains the same value as `start_line` for one-line declarations. // int32 end_line = 3; diff --git a/api/src/main/proto/spine/compiler/events.proto b/api/src/main/proto/spine/compiler/events.proto index 024c295665..fb364eb57b 100644 --- a/api/src/main/proto/spine/compiler/events.proto +++ b/api/src/main/proto/spine/compiler/events.proto @@ -342,7 +342,7 @@ option (every_is).java_type = "FileAwareEvent"; ServiceName service = 2 [(required) = true]; } - // Emitted when an service-level option is found. + // Emitted when a service-level option is found. message ServiceOptionDiscovered { option (is).java_type = "OptionAwareEvent"; @@ -359,7 +359,7 @@ option (every_is).java_type = "FileAwareEvent"; Service subject = 4 [(required) = true]; } - // Emitted when a service is completely discovered, including all the option and RPCs. + // Emitted when a service is completely discovered, including all the options and RPCs. message ServiceExited { // The file in which the service is defined. diff --git a/api/src/main/proto/spine/compiler/settings_events.proto b/api/src/main/proto/spine/compiler/settings_events.proto index 029a2db5a6..d3ab35dff5 100644 --- a/api/src/main/proto/spine/compiler/settings_events.proto +++ b/api/src/main/proto/spine/compiler/settings_events.proto @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ option java_multiple_files = true; import "spine/compiler/file.proto"; -// An event emitted when the user passes settings file to the Compiler. +// An event emitted when the user passes a settings file to the Compiler. message SettingsFileDiscovered { File file = 1 [(required) = true]; diff --git a/api/src/main/proto/spine/compiler/source.proto b/api/src/main/proto/spine/compiler/source.proto index f7fe29dd5f..b5137de9db 100644 --- a/api/src/main/proto/spine/compiler/source.proto +++ b/api/src/main/proto/spine/compiler/source.proto @@ -54,7 +54,7 @@ message ProtobufSourceFile { // ProtoFileHeader header = 2 [(required) = true, (validate) = true]; - // All the message types in this source files. + // All the message types in this source file. // // The keys are the type URLs of the message types. // @@ -62,7 +62,7 @@ message ProtobufSourceFile { // map type = 3 [(distinct) = true]; - // All the enum types in this source files. + // All the enum types in this source file. // // The keys are the type URLs of the enum types. // @@ -70,7 +70,7 @@ message ProtobufSourceFile { // map enum_type = 4 [(distinct) = true]; - // All the services declared in this source files. + // All the services declared in this source file. // // The keys are the type URLs of the services. // diff --git a/api/src/main/proto/spine/compiler/text.proto b/api/src/main/proto/spine/compiler/text.proto index 9cb7f066a6..8d1835cedd 100644 --- a/api/src/main/proto/spine/compiler/text.proto +++ b/api/src/main/proto/spine/compiler/text.proto @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * 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 * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following @@ -23,6 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + syntax = "proto3"; package spine.compiler; @@ -47,7 +48,7 @@ message Cursor { // A zero-based index of the line in the text. // - // If add a whole line at this coordinate, the value of this field + // If we add a whole line at this coordinate, the value of this field // means "add text _before_ this line". // int32 line = 1 [(min).value = "0"]; diff --git a/api/src/main/proto/spine/compiler/value.proto b/api/src/main/proto/spine/compiler/value.proto index d21dbfedaf..eff2400136 100644 --- a/api/src/main/proto/spine/compiler/value.proto +++ b/api/src/main/proto/spine/compiler/value.proto @@ -180,8 +180,8 @@ message Reference { // The type of the referenced value. // - // If the reference is obtained by parsing a "source" field option. - // The referenced field must have the same type as the field where the option is used. + // If the reference is obtained by parsing a "source" field option, + // the referenced field must have the same type as the field where the option is used. // If this is not the case, a compilation error will occur. // FieldType type = 1 [(required) = true]; diff --git a/api/src/test/java/io/spine/tools/compiler/settings/given/package-info.java b/api/src/test/java/io/spine/tools/compiler/settings/given/package-info.java index ced715ed3b..d094f4ee29 100644 --- a/api/src/test/java/io/spine/tools/compiler/settings/given/package-info.java +++ b/api/src/test/java/io/spine/tools/compiler/settings/given/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ */ /** - * Stub types for testings the {@link io.spine.compiler.settings} package. + * Stub types for testing the {@link io.spine.compiler.settings} package. */ @CheckReturnValue @NullMarked diff --git a/api/src/test/kotlin/io/spine/tools/compiler/ast/FilePatternsSpec.kt b/api/src/test/kotlin/io/spine/tools/compiler/ast/FilePatternsSpec.kt index 7773dc76b0..444f8d3efe 100644 --- a/api/src/test/kotlin/io/spine/tools/compiler/ast/FilePatternsSpec.kt +++ b/api/src/test/kotlin/io/spine/tools/compiler/ast/FilePatternsSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ internal class FilePatternsSpec { assertThrowing { infix(" ") } } - @Suppress("DEPRECATION") // Supporting for backward combability. + @Suppress("DEPRECATION") // Supporting for backward compatibility. @Test fun prefix() { assertThrowing { prefix("") } diff --git a/api/src/test/kotlin/io/spine/tools/compiler/render/SourceFileSpec.kt b/api/src/test/kotlin/io/spine/tools/compiler/render/SourceFileSpec.kt index 9d4dba8b2e..01d3da1106 100644 --- a/api/src/test/kotlin/io/spine/tools/compiler/render/SourceFileSpec.kt +++ b/api/src/test/kotlin/io/spine/tools/compiler/render/SourceFileSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,14 +66,14 @@ internal class SourceFileSpec { // The type of file was calculated by its name. (firstPsi is PsiJavaFile) shouldBe true - // Repeated calls returns the same instance. + // Repeated calls return the same instance. sourceFile.psi() shouldBe firstPsi sourceFile.psi() shouldBe firstPsi // Overwriting the code should result in getting a new instance of `PsiJavaFile`. sourceFile.overwrite(""" - public final class HelloWorld { - System.out.println("Hello, World!"); + public final class HelloWorld { + System.out.println("Hello, World!"); } """.ti() ) diff --git a/api/src/test/kotlin/io/spine/tools/compiler/settings/given/ActionFactorySpecEnv.kt b/api/src/test/kotlin/io/spine/tools/compiler/settings/given/ActionFactorySpecEnv.kt index fb7e088587..325d9c921a 100644 --- a/api/src/test/kotlin/io/spine/tools/compiler/settings/given/ActionFactorySpecEnv.kt +++ b/api/src/test/kotlin/io/spine/tools/compiler/settings/given/ActionFactorySpecEnv.kt @@ -43,7 +43,7 @@ import io.spine.tools.code.Java import io.spine.tools.code.Kotlin /** - * The class constructor of which matches the expectation of [RenderAction] + * The class constructor of which matches the expectation of [RenderAction]. */ @Suppress("unused") // To be called reflectively. class JustMatchingConstructor( @@ -103,7 +103,7 @@ class ActionNoParam( ) : ExposeParam(type, file, Empty.getDefaultInstance(), context) /** - * A stub render action implemented for Java that has [StringValue] parameter. + * A stub render action implemented for Java that has a [StringValue] parameter. */ class ActionStringParams( type: MessageType, diff --git a/api/src/test/proto/compiler/ast/field_exts_spec.proto b/api/src/test/proto/compiler/ast/field_exts_spec.proto index 0585d6e3b4..0eeda3f842 100644 --- a/api/src/test/proto/compiler/ast/field_exts_spec.proto +++ b/api/src/test/proto/compiler/ast/field_exts_spec.proto @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ option java_multiple_files = true; // A simple message with a message-level option and fields with options. message Tractor { - // An example of docs for a message level option. + // An example of docs for a message-level option. // The option is multi-line. option (entity) = { kind: ENTITY diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/Contexts.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/Contexts.kt index a26ea23753..3451e2b91e 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/Contexts.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/Contexts.kt @@ -98,7 +98,7 @@ public class CodeGenerationContext( * Lazy initializer for [insertionPointsContext] property. * * We have the initializer as a separate property to avoid unnecessary creation - * of `ThirdPartyContext` instance, if [insertionPointsContext] was never called. + * of a `ThirdPartyContext` instance, if [insertionPointsContext] was never called. * * @see [close] */ diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/DependencyView.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/DependencyView.kt index cb88cb8e17..555c3006ad 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/DependencyView.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/DependencyView.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import io.spine.tools.compiler.ast.File import io.spine.tools.compiler.ast.ProtobufDependency import io.spine.tools.compiler.ast.event.DependencyDiscovered import io.spine.tools.compiler.plugin.View -import io.spine.server.entity.alter /** * A view of a dependency Proto file. diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/InsertionPointsView.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/InsertionPointsView.kt index b486b353d6..7d5a13cf47 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/InsertionPointsView.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/InsertionPointsView.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import io.spine.tools.compiler.plugin.View import io.spine.tools.compiler.render.InsertedPoints import io.spine.tools.compiler.render.event.InsertionPointPrinted import io.spine.tools.compiler.render.insertedPoint -import io.spine.server.entity.alter /** * A view of insertion points added to a single code file. diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/Pipeline.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/Pipeline.kt index 0604b57c8b..c87692315f 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/Pipeline.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/Pipeline.kt @@ -153,7 +153,7 @@ public class Pipeline( } /** - * Obtains code generation context used by this pipeline. + * Obtains the code generation context used by this pipeline. */ @VisibleForTesting public val codegenContext: CodegenContext by lazy { diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/ProtoSourceFileView.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/ProtoSourceFileView.kt index 38f319248e..262a9cfd3a 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/ProtoSourceFileView.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/ProtoSourceFileView.kt @@ -35,7 +35,6 @@ import io.spine.tools.compiler.ast.event.FileEntered import io.spine.tools.compiler.ast.event.ServiceDiscovered import io.spine.tools.compiler.ast.event.TypeDiscovered import io.spine.tools.compiler.plugin.View -import io.spine.server.entity.alter /** * A view that collects information about a Protobuf source file. diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/SettingsView.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/SettingsView.kt index ad6b568fee..51c25cfac6 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/SettingsView.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/SettingsView.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import io.spine.tools.compiler.ast.nameWithoutExtension import io.spine.tools.compiler.plugin.View import io.spine.tools.compiler.settings.Settings import io.spine.tools.compiler.settings.event.SettingsFileDiscovered -import io.spine.server.entity.alter import io.spine.server.route.Route /** diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/CompilerEvents.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/CompilerEvents.kt index e235cfd077..eb461760ca 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/CompilerEvents.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/CompilerEvents.kt @@ -58,7 +58,7 @@ internal object CompilerEvents { * * The sequence is produced lazily. An element is produced only when polled. * - * The resulting sequence is always finite, it's limited by the type set. + * The resulting sequence is always finite; it's limited by the type set. */ fun parse( request: CodeGeneratorRequest, @@ -114,10 +114,10 @@ private class ProtoFileEvents( /** * Yields compiler events for the given file. * - * Opens with an [FileEntered][io.spine.tools.compiler.ast.event.FileEntered] event. + * Opens with a [FileEntered][io.spine.tools.compiler.ast.event.FileEntered] event. * Then go the events regarding the file metadata. * Then go the events regarding the file contents. - * At last, closes with an [FileExited][io.spine.tools.compiler.ast.event.FileExited] event. + * At last, closes with a [FileExited][io.spine.tools.compiler.ast.event.FileExited] event. */ suspend fun SequenceScope.produceEvents() { yield( @@ -158,7 +158,7 @@ private class ProtoFileEvents( } /** - * Convert this collection of [FileDescriptorProto] to a set of corresponding + * Converts this collection of [FileDescriptorProto] to a set of corresponding * instances of [FileDescriptor]. */ private fun Collection.toDescriptors(): ImmutableSet { diff --git a/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/MessageEvents.kt b/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/MessageEvents.kt index 8470625350..efe8a4493f 100644 --- a/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/MessageEvents.kt +++ b/backend/src/main/kotlin/io/spine/tools/compiler/backend/event/MessageEvents.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ internal class MessageEvents(header: ProtoFileHeader) : DeclarationEvents.produceOneofEvents( desc: OneofDescriptor @@ -173,9 +173,9 @@ internal class MessageEvents(header: ProtoFileHeader) : DeclarationEvents.produceEvents( desc: ServiceDescriptor diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index a61d839f8e..5b377272ee 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -132,7 +132,7 @@ val kotestJvmPluginVersion = "0.4.10" /** * @see [io.spine.dependency.test.Kover] */ -val koverVersion = "0.9.8" +val koverVersion = "0.9.9" /** * The version of the Shadow Plugin. @@ -222,7 +222,7 @@ dependOnBuildSrcJar() /** * Adds a dependency on a `buildSrc.jar`, iff: * 1) the `src` folder is missing, and - * 2) `buildSrc.jar` is present in `buildSrc/` folder instead. + * 2) `buildSrc.jar` is present in the `buildSrc/` folder instead. * * This approach is used in the scope of integration testing. */ @@ -241,7 +241,7 @@ fun Project.dependOnBuildSrcJar() { * Includes the `implementation` dependency on `artifactregistry-auth-common`, * with the version defined in [googleAuthToolVersion]. * - * `artifactregistry-auth-common` has transitive dependency on Gson and Apache `commons-codec`. + * `artifactregistry-auth-common` has a transitive dependency on Gson and Apache `commons-codec`. * Gson from version `2.8.6` until `2.8.9` is vulnerable to Deserialization of Untrusted Data * (https://devhub.checkmarx.com/cve-details/CVE-2022-25647/). * diff --git a/buildSrc/quality/checkstyle-suppressions.xml b/buildSrc/quality/checkstyle-suppressions.xml index a761fca351..9d169de7f7 100644 --- a/buildSrc/quality/checkstyle-suppressions.xml +++ b/buildSrc/quality/checkstyle-suppressions.xml @@ -1,7 +1,7 @@ io.spine.tools compiler -2.0.0-SNAPSHOT.062 +2.0.0-SNAPSHOT.063 2015 @@ -26,19 +26,19 @@ all modules and does not describe the project structure per-subproject. com.fasterxml.jackson jackson-bom - 2.22.0 + 2.22.1 compile com.fasterxml.jackson.core jackson-databind - 2.22.0 + 2.22.1 compile com.fasterxml.jackson.dataformat jackson-dataformat-yaml - 2.22.0 + 2.22.1 compile @@ -104,19 +104,19 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base - 2.0.0-SNAPSHOT.423 + 2.0.0-SNAPSHOT.426 compile io.spine spine-environment - 2.0.0-SNAPSHOT.423 + 2.0.0-SNAPSHOT.426 compile io.spine spine-format - 2.0.0-SNAPSHOT.423 + 2.0.0-SNAPSHOT.426 compile @@ -140,25 +140,25 @@ all modules and does not describe the project structure per-subproject. io.spine spine-server - 2.0.0-SNAPSHOT.381 + 2.0.0-SNAPSHOT.510 compile io.spine spine-time - 2.0.0-SNAPSHOT.242 + 2.0.0-SNAPSHOT.244 compile io.spine spine-time-java - 2.0.0-SNAPSHOT.242 + 2.0.0-SNAPSHOT.244 compile io.spine spine-validation-jvm-runtime - 2.0.0-SNAPSHOT.449 + 2.0.0-SNAPSHOT.450 compile @@ -170,13 +170,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools gradle-plugin-api - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 compile io.spine.tools jvm-tools - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 compile @@ -188,13 +188,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools plugin-base - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 compile io.spine.tools protobuf-setup-plugins - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 compile @@ -206,19 +206,19 @@ all modules and does not describe the project structure per-subproject. io.spine.tools psi-java - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 compile io.spine.tools server-testlib - 2.0.0-SNAPSHOT.381 + 2.0.0-SNAPSHOT.510 compile io.spine.tools tool-base - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 compile @@ -266,7 +266,7 @@ all modules and does not describe the project structure per-subproject. com.fasterxml.jackson.module jackson-module-kotlin - 2.22.0 + 2.22.1 runtime @@ -284,13 +284,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools plugin-testlib - 2.0.0-SNAPSHOT.403 + 2.0.0-SNAPSHOT.404 test io.spine.tools time-testlib - 2.0.0-SNAPSHOT.242 + 2.0.0-SNAPSHOT.244 test @@ -361,7 +361,7 @@ all modules and does not describe the project structure per-subproject. com.google.errorprone error_prone_core - 2.36.0 + 2.42.0 com.google.protobuf @@ -381,12 +381,12 @@ all modules and does not describe the project structure per-subproject. io.spine.tools compiler-cli-all - 2.0.0-SNAPSHOT.061 + 2.0.0-SNAPSHOT.062 io.spine.tools compiler-protoc-plugin - 2.0.0-SNAPSHOT.061 + 2.0.0-SNAPSHOT.062 io.spine.tools @@ -411,7 +411,7 @@ all modules and does not describe the project structure per-subproject. io.spine.tools validation-java-bundle - 2.0.0-SNAPSHOT.449 + 2.0.0-SNAPSHOT.450 org.jacoco diff --git a/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Artifacts.kt b/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Artifacts.kt index d2cabaa9b4..71977f1f98 100644 --- a/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Artifacts.kt +++ b/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Artifacts.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ public object Artifacts { public fun fatCli(version: String): String = "$group:compiler-cli-all:$version" /** - * Obtains Maven coordinates for Compiler command-line application. + * Obtains Maven coordinates for the Compiler command-line application. */ public fun cli(version: String): String = "$group:compiler-cli:$version" @@ -78,7 +78,7 @@ public object Artifacts { } /** - * Holds Maven references to `protoc` plugin artifact of the Compiler. + * Holds Maven references to the `protoc` plugin artifact of the Compiler. * * Provided to treat this important dependency in a type-safe way. */ diff --git a/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/CompilerSettings.kt b/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/CompilerSettings.kt index 7e4040c45f..90e87df18e 100644 --- a/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/CompilerSettings.kt +++ b/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/CompilerSettings.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import org.gradle.api.file.DirectoryProperty public interface CompilerSettings { /** - * Passes given names of Java classes to the Compiler as classes + * Passes the given names of Java classes to the Compiler as classes * extending the `io.spine.tools.compiler.plugin.Plugin` class. */ public fun plugins(vararg classNames: String) diff --git a/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Names.kt b/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Names.kt index 0069988193..d226c3c10d 100644 --- a/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Names.kt +++ b/gradle-api/src/main/kotlin/io/spine/tools/compiler/gradle/api/Names.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ public object Names { public const val EXTENSION_NAME: String = "compiler" /** - * The name of the Gradle Configuration created by Compiler Gradle plugin + * The name of the Gradle Configuration created by the Compiler Gradle plugin * for holding user-defined classpath. */ public const val USER_CLASSPATH_CONFIGURATION: String = "spineCompiler" diff --git a/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/ConfigureIdea.kt b/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/ConfigureIdea.kt index fc80101c1e..7f3c5abb1e 100644 --- a/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/ConfigureIdea.kt +++ b/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/ConfigureIdea.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ import org.gradle.plugins.ide.idea.model.IdeaModel import org.gradle.plugins.ide.idea.model.IdeaModule /** - * Ensures that the sources generated by Protobuf Gradle plugin are + * Ensures that the sources generated by the Protobuf Gradle plugin are * not included in the IDEA project. * * IDEA should only see the sources generated by the Compiler as @@ -77,7 +77,7 @@ private fun IdeaModule.setupDirectories(project: Project) { /** * Traverses [generatedSourceDirs][IdeaModule.generatedSourceDirs] excluding those - * belonging to `protoc` output directory. + * belonging to the `protoc` output directory. */ private fun IdeaModule.excludeFromGeneratedSourceDirs() { val protocOutputDir = project.protocOutputDir @@ -93,7 +93,7 @@ private fun IdeaModule.excludeFromGeneratedSourceDirs() { /** * Configures [generatedSourceDirs][IdeaModule.generatedSourceDirs] not to have - * the directories under `protoc` output root, and to have the Compiler target directories. + * the directories under the `protoc` output root, and to have the Compiler target directories. */ private fun IdeaModule.setGeneratedSourceDirs(protocTargets: List) { val project = project diff --git a/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/LaunchSpineCompiler.kt b/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/LaunchSpineCompiler.kt index 913f4a3f1a..ea3b3640d5 100644 --- a/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/LaunchSpineCompiler.kt +++ b/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/LaunchSpineCompiler.kt @@ -397,7 +397,7 @@ private fun LaunchSpineCompiler.createParametersFile() { /** * Tells if the request file for this task exists. * - * Logs error if the given source set contains `proto` directory that contains files, + * Logs an error if the given source set contains a `proto` directory that contains files, * which assumes that the request file should have been created. */ internal fun LaunchSpineCompiler.hasRequestFile(sourceSet: SourceSet): Boolean { diff --git a/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/Plugin.kt b/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/Plugin.kt index e5a07862bb..9cebaa8611 100644 --- a/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/Plugin.kt +++ b/gradle-plugin/src/main/kotlin/io/spine/tools/compiler/gradle/plugin/Plugin.kt @@ -172,7 +172,7 @@ internal val Project.compilerSettings: Extension /** * Creates configurations for [`spineCompilerRawArtifact`][COMPILER_RAW_ARTIFACT] and - * user-defined classpath, and adds dependency on [Artifacts.fatCli]. + * user-defined classpath, and adds a dependency on [Artifacts.fatCli]. */ private fun Project.createConfigurations(compilerVersion: String) { val artifactConfig = configurations.create(COMPILER_RAW_ARTIFACT) diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ClassName.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ClassName.kt index 310b198090..bb3313dbad 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ClassName.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ClassName.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,7 @@ public open class ClassName( public val isNested: Boolean = simpleNames.size > 1 /** - * Returns an expression that obtains `Class` instance of this class. + * Returns an expression that obtains the `Class` instance of this class. * * For example: * @@ -143,7 +143,7 @@ public open class ClassName( * * This is the name by which the class is referred to in Bytecode. * - * For regular Java classes, This is similar to [canonical], except that + * For regular Java classes, this is similar to [canonical], except that * in a binary name nested classes are separated by the dollar (`$`) sign, * and in canonical — by the dot (`.`) sign. */ @@ -230,7 +230,7 @@ public open class ClassName( public const val PACKAGE_SEPARATOR: String = "." /** - * The Unix style separator used to delimit directory names in a Java file name. + * The Unix-style separator used to delimit directory names in a Java file name. * * This separator is compatible with IntelliJ PSI. */ diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Expression.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Expression.kt index 27abb0556e..61d6a48ca2 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Expression.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Expression.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ package io.spine.tools.compiler.jvm * * Please, pay attention that the expressions with the same [code] * are not differentiated at runtime. The declared generic parameter - * is not preserved, it serves only for compile-time type safety. + * is not preserved; it serves only for compile-time type safety. * * If we compare the variables declared in the example above, * we will get `true`: diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldAccess.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldAccess.kt index 4f6b4b1f67..bdf6647903 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldAccess.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldAccess.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,13 +77,13 @@ internal constructor( MethodCall(message, addAllName, value) /** - * Constructs an `putField(..)` expression for the associated field. + * Constructs a `putField(..)` expression for the associated field. */ public fun put(key: Expression<*>, value: Expression<*>): MethodCall = MethodCall(message, putName, listOf(key, value)) /** - * Constructs an `putAllField(..)` expression for the associated field. + * Constructs a `putAllField(..)` expression for the associated field. */ public fun putAll(value: Expression<*>): MethodCall = MethodCall(message, putAllName, value) diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldConventions.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldConventions.kt index 3541b11f1c..57811e3b6e 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldConventions.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/FieldConventions.kt @@ -135,7 +135,7 @@ public open class FieldMethods( public companion object { /** - * Obtains the name of the getter + * Obtains the name of the getter. */ public fun getterOf(fieldName: String, cardinality: Cardinality): String { return FieldMethods(fieldName { value = fieldName }, cardinality).getter diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/JavaTypeName.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/JavaTypeName.kt index 169d337eec..d1f16720d1 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/JavaTypeName.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/JavaTypeName.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public abstract class JavaTypeName : NameElement, JavaElement { * 1. For classes and interfaces, this includes the package and any enclosing classes. * 2. For primitives, since they are not part of any package or class, the canonical * name is the same as the simple name. - * 3. When canonical name contains type variables, they are printed "as is". + * 3. When the canonical name contains type variables, they are printed "as is". */ public abstract val canonical: String diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/KeywordExpressions.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/KeywordExpressions.kt index c1088c3c2b..d4d17c8b92 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/KeywordExpressions.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/KeywordExpressions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public object Null : Expression("null") * * @param T The type of the `this` value. * - * @param explicit If `true`, the expression yields `this` keyword. + * @param explicit If `true`, the expression yields the `this` keyword. * Otherwise, it yields an empty string. */ public class This(explicit: Boolean = true) : Expression(if (explicit) "this" else "") diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Literal.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Literal.kt index 3b15ca76b6..8917e64685 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Literal.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Literal.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ public class StringLiteral(value: String) : Literal("\"$value\"") /** * A `long` literal. * - * Represents the same value as the given long, followed by `L` symbol. + * Represents the same value as the given long, followed by the `L` symbol. * For example, for "12" it will produce the following code: "12L". */ public class LongLiteral(value: Long) : Literal("${value}L") diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ParameterizedTypeName.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ParameterizedTypeName.kt index d5847d69bb..b932f9f1f4 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ParameterizedTypeName.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ParameterizedTypeName.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ package io.spine.tools.compiler.jvm * A parameterized Java type name. * * The type name can be parameterized with any other [JavaTypeName]. - * Usually, it is class or a generic type variable (like `T` or `E`). + * Usually, it is a class or a generic type variable (like `T` or `E`). * * Example usages: * diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtoFileHeaderExts.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtoFileHeaderExts.kt index 7b2d591ef0..cec2652f89 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtoFileHeaderExts.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtoFileHeaderExts.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public fun ProtoFileHeader.javaPackage(): String = ?: packageName /** - * Obtains a value of `java_multiple_files` option set for this file. + * Obtains a value of the `java_multiple_files` option set for this file. */ public fun ProtoFileHeader.javaMultipleFiles(): Boolean = optionList.find("java_multiple_files", BoolValue::class.java) diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtobufExpressions.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtobufExpressions.kt index 213a4c5526..44362582c9 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtobufExpressions.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/ProtobufExpressions.kt @@ -39,7 +39,7 @@ import io.spine.tools.compiler.ast.cardinality /** * An expression that yields the given Protobuf [ByteString] - * using [ByteString.copyFrom] method. + * using the [ByteString.copyFrom] method. */ public class CopyByteString(bytes: ByteString) : Expression( "$ByteStringClass.copyFrom(new byte[]{${bytes.toByteArray().joinToString()}})" @@ -48,7 +48,7 @@ public class CopyByteString(bytes: ByteString) : Expression( private val ByteStringClass = ByteString::class.qualifiedName!! /** - * Wraps this [Expression] into Protobuf `Any` using [TypeConverter.toAny] method. + * Wraps this [Expression] into Protobuf `Any` using the [TypeConverter.toAny] method. */ public fun Expression<*>.packToAny(): Expression { val type = ClassName(TypeConverter::class) diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Variables.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Variables.kt index 51f3ce0c1e..9efeaee19a 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Variables.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/Variables.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,7 @@ public class InitTypedVar( } /** - * Declares a local Java variable with the give [name] and [type]. + * Declares a local Java variable with the given [name] and [type]. * * An example usage: * diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotation.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotation.kt index da01667822..120c2ae721 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotation.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotation.kt @@ -62,7 +62,7 @@ public open class ModifiedTypeAnnotation( protected val generator: String = CLI_APP_CLASS, /** - * Tells if the annotated code should have [Modified.timestamp] parameter. + * Tells if the annotated code should have the [Modified.timestamp] parameter. * If `true`, the value will be set to the moment at local time when * the annotation was generated. */ @@ -136,9 +136,9 @@ public open class ModifiedTypeAnnotation( /** * Obtains the representation of the current time with the offset, - * as defined in the documentation of [Modified.timestamp] parameter. + * as defined in the documentation of the [Modified.timestamp] parameter. * - * The curren time is obtained via [Time.currentTime] so that tests can supply + * The current time is obtained via [Time.currentTime] so that tests can supply * custom [io.spine.base.Time.Provider]. */ @VisibleForTesting diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/TypeAnnotation.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/TypeAnnotation.kt index 720de1a4f4..f05932b1bf 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/TypeAnnotation.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/annotation/TypeAnnotation.kt @@ -133,7 +133,7 @@ public abstract class TypeAnnotation( * If a [Repeatable] annotation is attached to the annotation class, * it always applies the annotation and returns `true`. * - * If file does not contain a [BeforePrimaryDeclaration] insertion point, + * If the file does not contain a [BeforePrimaryDeclaration] insertion point, * it returns `false`. * * If the insertion point exists, it checks the presence of the annotation. diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclaration.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclaration.kt index 004b8bbc05..24daabfe49 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclaration.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclaration.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ import io.spine.tools.psi.java.lineNumber * The primary declaration is the top-level class, interface, annotation, or an enum type, * which matches by name with the class. * - * While technically Java allows other top-level declarations is the same file, those are rarely + * While technically Java allows other top-level declarations in the same file, those are rarely * used. `BeforePrimaryDeclaration` does not account for such declarations when searching for * a line number. * @@ -67,11 +67,11 @@ internal object BeforePrimaryDeclaration : NonRepeatingInsertionPoint { """ Could not find a primary declaration in the code: ```java - + """.ti() + text.trimIndent() + """ - + ``` """.ti() } diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/AbstractRenderer.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/AbstractRenderer.kt index 1bfc6a2bcd..8254c5f614 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/AbstractRenderer.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/AbstractRenderer.kt @@ -89,7 +89,7 @@ public abstract class AbstractRenderer, S : Message> : JavaRe /** * Tells if the [settings] allow this renderer to work. * - * If this method returns `false` the method [doRender] is never called. + * If this method returns `false`, the method [doRender] is never called. */ protected abstract fun isEnabled(settings: S): Boolean @@ -102,7 +102,7 @@ public abstract class AbstractRenderer, S : Message> : JavaRe * Renders the code traversing all the views calling [doRender], if * the rendering is [enabled][isEnabled] by [settings]. * - * If the method [isEnabled] returns `false` does nothing. + * If the method [isEnabled] returns `false`, does nothing. */ override fun render(sources: SourceFileSet) { this.sources = sources diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/BaseRenderer.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/BaseRenderer.kt index 99559872e2..99188bf93f 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/BaseRenderer.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/BaseRenderer.kt @@ -30,7 +30,7 @@ import com.google.protobuf.Empty import io.spine.base.EntityState /** - * An abstract base for renders that do not have settings. + * An abstract base for renderers that do not have settings. * * @param V the type of the view state that the renderer uses for code generation. * diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/CreateNestedClass.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/CreateNestedClass.kt index 8d4aa3b9b7..0d883ac4ad 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/CreateNestedClass.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/CreateNestedClass.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ public abstract class CreateNestedClass( /** * Creates the constructor for the class. * - * Default implementation creates a parameterless private constructor. + * The default implementation creates a parameterless private constructor. */ protected open fun createConstructor(cls: PsiClass): PsiMethod { val ctor = elementFactory.createPrivateConstructor( @@ -102,7 +102,7 @@ public abstract class CreateNestedClass( } /** - * Calls [tuneClass] and the inserts the tuned class into the message class. + * Calls [tuneClass] and inserts the tuned class into the message class. */ protected override fun doRender() { tuneClass() @@ -121,7 +121,7 @@ public abstract class CreateNestedClass( /** * Generates an annotation to be added for the created class. * - * Overriding methods may return custom annotation or `null`, if no annotation is necessary. + * Overriding methods may return a custom annotation or `null`, if no annotation is necessary. */ protected abstract fun createAnnotation(): PsiAnnotation? diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/MessageAction.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/MessageAction.kt index 277b75ae37..dac3dc151c 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/MessageAction.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/MessageAction.kt @@ -91,7 +91,7 @@ public abstract class MessageAction

( protected val messageJavadocRef: String = "{@link ${messageClass.simpleName}}" /** - * Adds a nested class the top class of the given [file]. + * Adds a nested class to the top class of the given [file]. */ @Suppress("TooGenericExceptionCaught") // ... to log diagnostic. override fun render() { diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/TypeListRenderer.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/TypeListRenderer.kt index 15792ef58a..ccb89698cc 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/TypeListRenderer.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/render/TypeListRenderer.kt @@ -35,12 +35,12 @@ import io.spine.tools.compiler.render.TypeListActions import io.spine.tools.code.Java /** - * An abstract base for Java renders handling message types. + * An abstract base for Java renderers handling message types. * * This class applies multiple render actions to multiple types. * For applying rendering actions to one type, please see [TypeRenderer]. * - * @param V The type of the view state that gathers messages types served by this renderer. + * @param V The type of the view state that gathers message types served by this renderer. * The type is an [EntityState] that has [File] as its identifier and * implements the [TypeListActions] interface. * @param S The type of the settings used by the renderer. @@ -52,7 +52,7 @@ public abstract class TypeListRenderer : AbstractRenderer( /** * Implement this method to render the code for the given entity state [type] - * the source code of which present in the given [file]. + * the source code of which is present in the given [file]. */ protected abstract fun doRender(type: MessageType, file: SourceFile) diff --git a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/style/PsiJavaCodeStyleFormatter.kt b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/style/PsiJavaCodeStyleFormatter.kt index dff582b71e..a54a7f34f1 100644 --- a/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/style/PsiJavaCodeStyleFormatter.kt +++ b/jvm/src/main/kotlin/io/spine/tools/compiler/jvm/style/PsiJavaCodeStyleFormatter.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,10 +45,10 @@ import io.spine.tools.psi.java.Parser import io.spine.tools.psi.java.execute /** - * Reformats Java source code files using settings passed as [JavaCodeStyle] instance. + * Reformats Java source code files using settings passed as a [JavaCodeStyle] instance. * * If no settings are passed, default Java code style settings used in Spine SDK are applied. - * + * * @see javaCodeStyleDefaults * @see PalantirJavaFormatter */ diff --git a/jvm/src/main/proto/spine/compiler/jvm/style.proto b/jvm/src/main/proto/spine/compiler/jvm/style.proto index 6015c1de55..599da79133 100644 --- a/jvm/src/main/proto/spine/compiler/jvm/style.proto +++ b/jvm/src/main/proto/spine/compiler/jvm/style.proto @@ -61,7 +61,7 @@ message InnerClassImports { repeated string exclude = 2; } -// Settings for on-demand or start import (`*`) to be used instead of +// Settings for on-demand or star import (`*`) to be used instead of // individual import statements in a Java file. message ImportOnDemand { diff --git a/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotationSpec.kt b/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotationSpec.kt index d424aaae8a..00a69b0473 100644 --- a/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotationSpec.kt +++ b/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/annotation/ModifiedTypeAnnotationSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ internal class ModifiedTypeAnnotationSpec : WithSourceFileSet() { @BeforeEach fun freezeTime() { - // Have time shifted, event when testing at UTC. + // Have time shifted, even when testing at UTC. frozenTime = ZonedDateTime.now(ZoneId.of("Europe/Istanbul")) val timeProvider = FrozenPartyAtTimezone(frozenTime!!) Time.setProvider(timeProvider) diff --git a/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforeNestedTypeDeclarationSpec.kt b/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforeNestedTypeDeclarationSpec.kt index 36859b7496..146a7657e9 100644 --- a/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforeNestedTypeDeclarationSpec.kt +++ b/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforeNestedTypeDeclarationSpec.kt @@ -94,7 +94,7 @@ class BeforeNestedTypeDeclarationSpec { } /** - * Prepares test environment for the integration tests that use + * Prepares the test environment for the integration tests that use * [BeforePrimaryDeclaration] for adding the [Generated] annotation. */ companion object { diff --git a/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclarationSpec.kt b/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclarationSpec.kt index e494f4fb7b..6a520f990f 100644 --- a/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclarationSpec.kt +++ b/jvm/src/test/kotlin/io/spine/tools/compiler/jvm/file/BeforePrimaryDeclarationSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ class BeforePrimaryDeclarationSpec { } /** - * Prepares test environment for the integration tests that use + * Prepares the test environment for the integration tests that use * [BeforePrimaryDeclaration] for adding the [Generated] annotation. */ companion object { @@ -113,8 +113,8 @@ class BeforePrimaryDeclarationSpec { } /** - * Integration tests for using `BeforePrimaryDeclaration` in a pipeline which - * annotates top level types with the [Generated] annotation. + * Integration tests for using `BeforePrimaryDeclaration` in a pipeline that + * annotates top-level types with the [Generated] annotation. * See the companion object for the pipeline definition. */ @Nested inner class @@ -161,11 +161,11 @@ class BeforePrimaryDeclarationSpec { private const val PACKAGE_NAME = "given.java.file" private val classSource = """ - /* File header comment. */ + /* File header comment. */ package $PACKAGE_NAME; - /** - * Top level class Javadoc. + /** + * Top level class Javadoc. */ public class TopLevelClass { @@ -182,7 +182,7 @@ private val interfaceSource = """ """.ti() private val enumSource = """ - // File header comment. + // File header comment. package $PACKAGE_NAME; public enum TopLevelEnum { ONE, TWO } """.ti() diff --git a/params/src/main/kotlin/io/spine/tools/compiler/params/Parameter.kt b/params/src/main/kotlin/io/spine/tools/compiler/params/Parameter.kt index 89edc02f38..3c0535adda 100644 --- a/params/src/main/kotlin/io/spine/tools/compiler/params/Parameter.kt +++ b/params/src/main/kotlin/io/spine/tools/compiler/params/Parameter.kt @@ -52,12 +52,12 @@ public sealed class Parameter( /** * A short name of the parameter, which conventionally comes with the `-` prefix - * if the short name is one letter, and with `--` prefix for two or more letters. + * if the short name is one letter, and with the `--` prefix for two or more letters. */ public val shortName: String, /** - * Description of the parameter with the usage instructions which + * Description of the parameter with the usage instructions that * could be passed as a raw string. */ help: String diff --git a/params/src/main/proto/spine/compiler/params/pipeline_parameters.proto b/params/src/main/proto/spine/compiler/params/pipeline_parameters.proto index fc57e9e564..6c5e1b57de 100644 --- a/params/src/main/proto/spine/compiler/params/pipeline_parameters.proto +++ b/params/src/main/proto/spine/compiler/params/pipeline_parameters.proto @@ -77,7 +77,7 @@ message PipelineParameters { // `target_root` directories. // // Source and target directories are paired up according to the order they - // are provided, e.g., the files from first source root are written to the first + // are provided, e.g., the files from the first source root are written to the first // target root and so on. // // When specifying multiple directories, some of them are allowed to be non-existent. diff --git a/protoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.kt b/protoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.kt index 8815d10381..f9860998d4 100644 --- a/protoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.kt +++ b/protoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,12 @@ import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse import io.spine.tools.code.proto.CodeGeneratorRequestWriter /** - * Stores received `CodeGeneratorRequest` message to the file the name of which is passed as + * Stores the received `CodeGeneratorRequest` message to the file the name of which is passed as * the value of the [parameter][CodeGeneratorRequest.getParameter] property of the request. * * The name of the file is [Base64][java.util.Base64] encoded. * - * The function returns empty [CodeGeneratorRequest] written to [System.out] + * The function returns an empty [CodeGeneratorRequest] written to [System.out] * according to the `protoc` plugin * [protocol](https://protobuf.dev/reference/cpp/api-docs/google.protobuf.compiler.plugin.pb/). * diff --git a/test-env/src/main/kotlin/io/spine/tools/compiler/test/AnnotationInsertionPointPrinter.kt b/test-env/src/main/kotlin/io/spine/tools/compiler/test/AnnotationInsertionPointPrinter.kt index daca062b28..d1a68e0b89 100644 --- a/test-env/src/main/kotlin/io/spine/tools/compiler/test/AnnotationInsertionPointPrinter.kt +++ b/test-env/src/main/kotlin/io/spine/tools/compiler/test/AnnotationInsertionPointPrinter.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public class AnnotationInsertionPointPrinter : public enum class AnnotationInsertionPoint : NonRepeatingInsertionPoint { /** - * An insertion point in the imports black. + * An insertion point in the imports block. * * This insertion point allows importing types into the Java file. */ @@ -62,7 +62,7 @@ public enum class AnnotationInsertionPoint : NonRepeatingInsertionPoint { }, /** - * An insertion point before the return type of method called `foo`. + * An insertion point before the return type of the method called `foo`. * * This insertion point allows annotating the return type. */ diff --git a/test-env/src/main/kotlin/io/spine/tools/compiler/test/DeletedTypeView.kt b/test-env/src/main/kotlin/io/spine/tools/compiler/test/DeletedTypeView.kt index 87632dae86..40af8bcb23 100644 --- a/test-env/src/main/kotlin/io/spine/tools/compiler/test/DeletedTypeView.kt +++ b/test-env/src/main/kotlin/io/spine/tools/compiler/test/DeletedTypeView.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import io.spine.tools.compiler.ast.TypeName import io.spine.tools.compiler.ast.event.TypeDiscovered import io.spine.tools.compiler.plugin.View import io.spine.tools.compiler.plugin.ViewRepository -import io.spine.server.entity.update import io.spine.server.route.Route /** @@ -65,7 +64,7 @@ public class DeletedTypeView : View( /** * This class of the repository is used for tests checking the case when both - * view class and a repository class are passed to the plugin constructor. + * a view class and a repository class are passed to the plugin constructor. */ public class DeletedTypeRepository : ViewRepository() diff --git a/test-env/src/main/kotlin/io/spine/tools/compiler/test/InternalMessageView.kt b/test-env/src/main/kotlin/io/spine/tools/compiler/test/InternalMessageView.kt index e3b083562f..5ff8c2963d 100644 --- a/test-env/src/main/kotlin/io/spine/tools/compiler/test/InternalMessageView.kt +++ b/test-env/src/main/kotlin/io/spine/tools/compiler/test/InternalMessageView.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import io.spine.core.Subscribe import io.spine.tools.compiler.ast.TypeName import io.spine.tools.compiler.ast.event.TypeEntered import io.spine.tools.compiler.plugin.View -import io.spine.server.entity.update import io.spine.server.route.Route /** diff --git a/test-env/src/main/kotlin/io/spine/tools/compiler/test/TestEnvOptionsProvider.kt b/test-env/src/main/kotlin/io/spine/tools/compiler/test/TestEnvOptionsProvider.kt index 6ed4c8d4cb..9f03e0f6ec 100644 --- a/test-env/src/main/kotlin/io/spine/tools/compiler/test/TestEnvOptionsProvider.kt +++ b/test-env/src/main/kotlin/io/spine/tools/compiler/test/TestEnvOptionsProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import com.google.protobuf.ExtensionRegistry import io.spine.option.OptionsProvider /** - * Register options declared in [extra_opts.proto][XtraOptsProto] file. + * Registers options declared in the [extra_opts.proto][XtraOptsProto] file. */ @AutoService(OptionsProvider::class) public class TestEnvOptionsProvider : OptionsProvider { diff --git a/test-env/src/main/kotlin/io/spine/tools/compiler/test/UnderscorePrefixRenderer.kt b/test-env/src/main/kotlin/io/spine/tools/compiler/test/UnderscorePrefixRenderer.kt index 3e0be12403..24c6356299 100644 --- a/test-env/src/main/kotlin/io/spine/tools/compiler/test/UnderscorePrefixRenderer.kt +++ b/test-env/src/main/kotlin/io/spine/tools/compiler/test/UnderscorePrefixRenderer.kt @@ -34,7 +34,7 @@ import io.spine.server.query.select import io.spine.tools.code.Java /** - * A test [Renderer] that prepends underscore before an [InternalType] in all source files. + * A test [Renderer] that prepends an underscore before an [InternalType] in all source files. */ public class UnderscorePrefixRenderer : Renderer(Java) { diff --git a/testlib/src/main/kotlin/io/spine/testing/compiler/AbstractCompilationErrorTest.kt b/testlib/src/main/kotlin/io/spine/testing/compiler/AbstractCompilationErrorTest.kt index 65eb96e577..6feed6a7c6 100644 --- a/testlib/src/main/kotlin/io/spine/testing/compiler/AbstractCompilationErrorTest.kt +++ b/testlib/src/main/kotlin/io/spine/testing/compiler/AbstractCompilationErrorTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,7 @@ public abstract class AbstractCompilationErrorTest { /** * Asserts that the messages represented by the given [descriptor] - * fails the compilation process. + * fail the compilation process. */ public fun assertCompilationFails(descriptor: Descriptor): Compilation.Error { val setup = createSetup(descriptor) diff --git a/testlib/src/main/kotlin/io/spine/testing/compiler/DescriptorFilters.kt b/testlib/src/main/kotlin/io/spine/testing/compiler/DescriptorFilters.kt index f67eb3a864..e00600331d 100644 --- a/testlib/src/main/kotlin/io/spine/testing/compiler/DescriptorFilters.kt +++ b/testlib/src/main/kotlin/io/spine/testing/compiler/DescriptorFilters.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,10 +33,10 @@ import io.spine.tools.compiler.backend.DescriptorFilter /** * Creates a predicate accepting only the given [descriptor] of * a Protobuf declaration and the descriptor of the file in - * which declaration was made, so that a [Pipeline][io.spine.tools.compiler.backend.Pipeline] + * which the declaration was made, so that a [Pipeline][io.spine.tools.compiler.backend.Pipeline] * can get down to the [descriptor] of interest. * - * If the given [descriptor] is [FileDescriptor] the predicate accepts + * If the given [descriptor] is [FileDescriptor], the predicate accepts * the file itself, all the declarations made in this file. */ public fun acceptingOnly(descriptor: GenericDescriptor): DescriptorFilter = diff --git a/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineParametersExts.kt b/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineParametersExts.kt index 00c942f0d8..195662a8d7 100644 --- a/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineParametersExts.kt +++ b/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineParametersExts.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,7 @@ public fun PipelineParameters.Builder.withRoots( } /** - * Creates a partial instance of [PipelineParameters] that refer to the given settings directory. + * Creates a partial instance of [PipelineParameters] that refers to the given settings directory. */ public fun parametersWithSettingsDir(dir: Path): @NonValidated PipelineParameters = PipelineParameters.newBuilder() diff --git a/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineSetup.kt b/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineSetup.kt index 86cc2bf823..3ce0589465 100644 --- a/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineSetup.kt +++ b/testlib/src/main/kotlin/io/spine/testing/compiler/PipelineSetup.kt @@ -85,7 +85,7 @@ import org.gradle.testfixtures.ProjectBuilder * for creation of a [Pipeline] automatically. Configuration steps associated with this approach are * described below. * - * The class also allows fine-tuned way of working using its constructor directly for the usage + * The class also allows a fine-tuned way of working using its constructor directly for the usage * scenarios when generated code and [CodeGeneratorRequest] are already available or generated via * a custom procedure. * @@ -163,7 +163,7 @@ import org.gradle.testfixtures.ProjectBuilder * The primary usage scenario for this parameter is accepting only * descriptors of interest when running tests. * @param writeSettings A callback for writing plugin settings before the pipeline is created. - * @constructor Creates in instance for creating [Pipeline] for testing the given [plugins]. + * @constructor Creates an instance for creating [Pipeline] for testing the given [plugins]. * * @see [byResources] * @see [SettingsDirectory] @@ -180,7 +180,7 @@ public class PipelineSetup( private val writeSettings: (SettingsDirectory) -> Unit ) { /** - * Parameters with populated source and target rood directories passed as `inputDir` and + * Parameters with populated source and target root directories passed as `inputDir` and * `outputDir` constructor parameters. */ public val params: PipelineParameters = params.toBuilder() @@ -253,7 +253,7 @@ public class PipelineSetup( createPipelineWithBlackBox() /** - * Creates a [Pipeline] and a [BlackBox] to for testing the [CodeGenerationContext] of + * Creates a [Pipeline] and a [BlackBox] for testing the [CodeGenerationContext] of * the created pipeline. * * The created instances of [Pipeline] and [BlackBox] are "entangled" in the sense diff --git a/testlib/src/main/kotlin/io/spine/testing/compiler/recorder/RecordingPlugin.kt b/testlib/src/main/kotlin/io/spine/testing/compiler/recorder/RecordingPlugin.kt index 3f938f8637..b853e65c4a 100644 --- a/testlib/src/main/kotlin/io/spine/testing/compiler/recorder/RecordingPlugin.kt +++ b/testlib/src/main/kotlin/io/spine/testing/compiler/recorder/RecordingPlugin.kt @@ -29,7 +29,6 @@ package io.spine.testing.compiler.recorder import io.spine.base.EventMessage import io.spine.core.External import io.spine.core.Subscribe -import io.spine.server.entity.alter import io.spine.server.query.Querying import io.spine.server.query.select import io.spine.server.route.Route diff --git a/testlib/src/testFixtures/proto/given/domain/gas_transportation.proto b/testlib/src/testFixtures/proto/given/domain/gas_transportation.proto index f876adbb7c..8a15f167f8 100644 --- a/testlib/src/testFixtures/proto/given/domain/gas_transportation.proto +++ b/testlib/src/testFixtures/proto/given/domain/gas_transportation.proto @@ -1,22 +1,29 @@ /* -* Copyright 2024, TeamDev. All rights reserved. -* -* Redistribution and use in source and/or binary forms, with or without -* modification, must retain the above copyright notice and the following -* disclaimer. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright 2026, TeamDev. All rights reserved. + * + * 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 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + syntax = "proto3"; package given.domain; @@ -24,7 +31,7 @@ package given.domain; // // This is a "vanilla" Protobuf file, which does not use Spine-specific features like // custom options such as `type_url_prefix` or validation constraints. -// We also use "pure" Protobuf Java `protoc` plugin to process these files so that +// We also use the "pure" Protobuf Java `protoc` plugin to process these files so that // we recreate conditions we have before the Compiler gets into play after `protoc` // finishes its work. // diff --git a/testlib/src/testFixtures/proto/given/domain/oil_refinery.proto b/testlib/src/testFixtures/proto/given/domain/oil_refinery.proto index 1f1ab33a8b..c87dd86f2d 100644 --- a/testlib/src/testFixtures/proto/given/domain/oil_refinery.proto +++ b/testlib/src/testFixtures/proto/given/domain/oil_refinery.proto @@ -1,22 +1,29 @@ /* -* Copyright 2024, TeamDev. All rights reserved. -* -* Redistribution and use in source and/or binary forms, with or without -* modification, must retain the above copyright notice and the following -* disclaimer. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright 2026, TeamDev. All rights reserved. + * + * 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 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + syntax = "proto3"; package given.domain; @@ -24,7 +31,7 @@ package given.domain; // // This is a "vanilla" Protobuf file, which does not use Spine-specific features like // custom options such as `type_url_prefix` or validation constraints. -// We also use "pure" Protobuf Java `protoc` plugin to process these files so that +// We also use the "pure" Protobuf Java `protoc` plugin to process these files so that // we recreate conditions we have before the Compiler gets into play after `protoc` // finishes its work. // diff --git a/tests/README.md b/tests/README.md index 4328568397..879cce6e1c 100644 --- a/tests/README.md +++ b/tests/README.md @@ -55,7 +55,7 @@ It is more complicated under Windows. ### Symlink support in Windows Symlink creation under Windows requires either Administrator privileges or -the [Developer Mode on][developer-mode] turned on. If you develop under Windows you may want +the [Developer Mode on][developer-mode] turned on. If you develop under Windows, you may want to turn the [Developer Mode on][developer-mode] for your workstation. The recommended configuration under Windows is: diff --git a/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/annotation/FieldGetter.java b/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/annotation/FieldGetter.java index e7cea9b2ff..89add0dc4d 100644 --- a/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/annotation/FieldGetter.java +++ b/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/annotation/FieldGetter.java @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ * An insertion point at the line right before a getter method of the given field. * *

This implementation should only be used for test purposes. It might not cover all the possible - * edge cases when fining the line where the getter is. + * edge cases when finding the line where the getter is. */ final class FieldGetter implements NonRepeatingInsertionPoint { diff --git a/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/ClassScope.java b/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/ClassScope.java index 385c8133d9..0d305fe52d 100644 --- a/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/ClassScope.java +++ b/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/ClassScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,8 @@ public String getLabel() { /** * Finds the place to put the {@code ClassScope} insertion point among the given code lines. * - *

To locate our insertion point, we use Protoc native {@code class_scope} insertion point. + *

To locate our insertion point, we use the Protoc native + * {@code class_scope} insertion point. * *

If there is no Protoc native insertion point to be found, the {@code ClassScope} point * is not added either. diff --git a/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/UuidJavaRenderer.java b/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/UuidJavaRenderer.java index 6abd493079..1b9c1bda08 100644 --- a/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/UuidJavaRenderer.java +++ b/tests/compiler-extension/src/main/java/io/spine/tools/compiler/test/uuid/UuidJavaRenderer.java @@ -45,7 +45,7 @@ *

A UUID type is a message that only has one field — a {@code string} field * called {@code uuid}. */ -@SuppressWarnings("unused") // Accessed by the Compiler via refection. +@SuppressWarnings("unused") // Accessed by the Compiler via reflection. public final class UuidJavaRenderer extends JavaRenderer { /** diff --git a/version.gradle.kts b/version.gradle.kts index 4969848845..ba245b1ed5 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -30,7 +30,7 @@ * This version is also used by integration test projects. * E.g. see `tests/consumer/build.gradle.kts`. */ -private val compilerVersion = "2.0.0-SNAPSHOT.062" +private val compilerVersion = "2.0.0-SNAPSHOT.063" extra.set("compilerVersion", compilerVersion) /**