Skip to content

Conversation

@egorikftp
Copy link
Member

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Walkthrough

This pull request refactors test resources and test cases in the image vector parser module. The changes include renaming test resources and test cases from "EmptyImageVector" to "WithoutPath", removing obsolete test resource files for EmptyImageVector and the original AllPathParams definitions, and introducing a new ExpectedWithoutPathImageVector test expectation file. Additionally, the AllPathParams test resource files in both lazy and backing implementations are updated with significantly modified path drawing command sequences. The expected test file for AllPathParams is updated to include the autoMirror = true parameter in the ImageVector.Builder call.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to evaluate relevance to the changeset. Add a description explaining the refactoring's purpose, scope, and impact on test structure and icon reusability.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Reuse kt icons across tests' accurately summarizes the main change: refactoring test resources to enable icon reuse across multiple test files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch task/reuse-icons-in-test

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08fb11b and 9849f67.

📒 Files selected for processing (11)
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/ExpectedWithoutPathImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/EmptyImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/EmptyImageVector.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/AllPathParams.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/EmptyPaths.kt
  • sdk/test/sharedTestResources/imagevector/kt/lazy/AllPathParams.kt
  • sdk/test/sharedTestResources/imagevector/kt/lazy/EmptyPaths.kt
💤 Files with no reviewable changes (4)
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/EmptyImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/EmptyImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/AllPathParams.kt
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-10-21T20:55:27.073Z
Learnt from: egorikftp
Repo: ComposeGears/Valkyrie PR: 651
File: tools/idea-plugin/build.gradle.kts:147-175
Timestamp: 2025-10-21T20:55:27.073Z
Learning: In Gradle Kotlin DSL (.gradle.kts) scripts, the types `org.gradle.api.artifacts.ArtifactCollection` and `org.gradle.api.artifacts.component.ModuleComponentIdentifier` are implicitly available and do not require explicit import statements.

Applied to files:

  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
📚 Learning: 2025-12-07T20:07:49.753Z
Learnt from: egorikftp
Repo: ComposeGears/Valkyrie PR: 750
File: tools/gradle-plugin/src/main/kotlin/io/github/composegears/valkyrie/gradle/internal/task/GenerateImageVectorsTask.kt:71-85
Timestamp: 2025-12-07T20:07:49.753Z
Learning: In the Valkyrie Gradle plugin (Kotlin), the `useFlatPackage` flag in `IconPackExtension` is only applicable when nested packs are configured. For single icon packs (without nested packs), the flag is intentionally not propagated to `ImageVectorGeneratorConfig` as there is no package hierarchy to flatten.

Applied to files:

  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
📚 Learning: 2025-09-27T22:19:48.762Z
Learnt from: t-regbs
Repo: ComposeGears/Valkyrie PR: 587
File: sdk/generator/xml/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/generator/xml/XmlSerializer.kt:13-16
Timestamp: 2025-09-27T22:19:48.762Z
Learning: The VectorDrawable.Child sealed interface in the Valkyrie project only has Group and Path as implementations. ClipPath is not implemented in this project, despite being supported in Android's official VectorDrawable specification.

Applied to files:

  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/ExpectedWithoutPathImageVector.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/AllPathParams.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (5)
sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/AllPathParams.kt (1)

18-18: LGTM!

The addition of autoMirror = true extends test coverage to include this builder parameter. The path commands in the expected file are consistent with the corresponding lazy and backing test resources.

sdk/test/sharedTestResources/imagevector/kt/lazy/AllPathParams.kt (1)

34-52: LGTM - comprehensive path operation coverage.

The expanded path commands provide exhaustive test coverage for all path operation types including relative/absolute variants. The mix of named parameters (line 49: isMoreThanHalf = false, isPositiveArc = false) and positional booleans (line 50: true, false) for arcTo effectively tests both syntax styles that the parser must handle.

sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/ExpectedWithoutPathImageVector.kt (1)

6-12: LGTM!

The rename from ExpectedEmptyImageVector to ExpectedWithoutPathImageVector improves clarity by explicitly describing what the test vector lacks, rather than the ambiguous "empty".

sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt (1)

31-38: LGTM!

The test rename and path updates correctly align with the new shared test resource structure.

sdk/test/sharedTestResources/imagevector/kt/backing/AllPathParams.kt (1)

38-56: LGTM!

The backing implementation correctly mirrors the lazy version's path commands, ensuring consistent test behavior across both initialization patterns.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt (1)

64-83: Migrate IconWithGroup and SinglePath test resources to shared location.

Most tests in this file use the new shared resource path pattern (imagevector/kt/lazy/ and imagevector/kt/backing/), but IconWithGroup and SinglePath tests still reference the old local paths (lazy/ and backing/). The test files exist only in the old locations; they should either be migrated to sdk/test/sharedTestResources/imagevector/kt/ to maintain consistency with other tests, or there should be a clear reason to keep them isolated.

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08fb11b and 9849f67.

📒 Files selected for processing (11)
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/ExpectedWithoutPathImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/EmptyImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/EmptyImageVector.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/AllPathParams.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/EmptyPaths.kt
  • sdk/test/sharedTestResources/imagevector/kt/lazy/AllPathParams.kt
  • sdk/test/sharedTestResources/imagevector/kt/lazy/EmptyPaths.kt
💤 Files with no reviewable changes (4)
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/EmptyImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/lazy/AllPathParams.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/EmptyImageVector.kt
  • sdk/intellij/psi/imagevector/src/test/resources/backing/AllPathParams.kt
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-10-21T20:55:27.073Z
Learnt from: egorikftp
Repo: ComposeGears/Valkyrie PR: 651
File: tools/idea-plugin/build.gradle.kts:147-175
Timestamp: 2025-10-21T20:55:27.073Z
Learning: In Gradle Kotlin DSL (.gradle.kts) scripts, the types `org.gradle.api.artifacts.ArtifactCollection` and `org.gradle.api.artifacts.component.ModuleComponentIdentifier` are implicitly available and do not require explicit import statements.

Applied to files:

  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
📚 Learning: 2025-12-07T20:07:49.753Z
Learnt from: egorikftp
Repo: ComposeGears/Valkyrie PR: 750
File: tools/gradle-plugin/src/main/kotlin/io/github/composegears/valkyrie/gradle/internal/task/GenerateImageVectorsTask.kt:71-85
Timestamp: 2025-12-07T20:07:49.753Z
Learning: In the Valkyrie Gradle plugin (Kotlin), the `useFlatPackage` flag in `IconPackExtension` is only applicable when nested packs are configured. For single icon packs (without nested packs), the flag is intentionally not propagated to `ImageVectorGeneratorConfig` as there is no package hierarchy to flatten.

Applied to files:

  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
📚 Learning: 2025-09-27T22:19:48.762Z
Learnt from: t-regbs
Repo: ComposeGears/Valkyrie PR: 587
File: sdk/generator/xml/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/generator/xml/XmlSerializer.kt:13-16
Timestamp: 2025-09-27T22:19:48.762Z
Learning: The VectorDrawable.Child sealed interface in the Valkyrie project only has Group and Path as implementations. ClipPath is not implemented in this project, despite being supported in Android's official VectorDrawable specification.

Applied to files:

  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/ExpectedWithoutPathImageVector.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/AllPathParams.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (5)
sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/AllPathParams.kt (1)

18-18: LGTM!

The addition of autoMirror = true extends test coverage to include this builder parameter. The path commands in the expected file are consistent with the corresponding lazy and backing test resources.

sdk/test/sharedTestResources/imagevector/kt/lazy/AllPathParams.kt (1)

34-52: LGTM - comprehensive path operation coverage.

The expanded path commands provide exhaustive test coverage for all path operation types including relative/absolute variants. The mix of named parameters (line 49: isMoreThanHalf = false, isPositiveArc = false) and positional booleans (line 50: true, false) for arcTo effectively tests both syntax styles that the parser must handle.

sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/ExpectedWithoutPathImageVector.kt (1)

6-12: LGTM!

The rename from ExpectedEmptyImageVector to ExpectedWithoutPathImageVector improves clarity by explicitly describing what the test vector lacks, rather than the ambiguous "empty".

sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt (1)

31-38: LGTM!

The test rename and path updates correctly align with the new shared test resource structure.

sdk/test/sharedTestResources/imagevector/kt/backing/AllPathParams.kt (1)

38-56: LGTM!

The backing implementation correctly mirrors the lazy version's path commands, ensuring consistent test behavior across both initialization patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants