Skip to content

fix: apply spotless formatting to gradle-plugin files#147

Merged
kirich1409 merged 1 commit intomainfrom
fix/spotless-violations
Apr 3, 2026
Merged

fix: apply spotless formatting to gradle-plugin files#147
kirich1409 merged 1 commit intomainfrom
fix/spotless-violations

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Lint & API Check passes

🤖 Generated with Claude Code

Fixes spotless violations introduced by recent commits (ConfigParamGenerator,
ProguardRulesGenerator, R8EliminationTest) — blank lines, inline comments,
and parameter formatting per ktlint rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 3, 2026 06:18
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Apply spotless formatting to gradle-plugin files

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Remove unnecessary blank lines between when branches
• Reformat inline comments to separate lines per ktlint
• Adjust method parameter formatting for multi-line signatures
• Fix trailing commas and indentation in method chains
Diagram
flowchart LR
  A["Spotless Violations"] -->|Remove blank lines| B["ConfigParamGenerator.kt"]
  A -->|Reformat comments| C["ProguardRulesGenerator.kt"]
  A -->|Fix formatting| D["R8EliminationTest.kt"]
  B --> E["Compliant Code"]
  C --> E
  D --> E
Loading

Grey Divider

File Changes

1. featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/ConfigParamGenerator.kt Formatting +0/-3

Remove unnecessary blank lines in when expression

• Remove blank lines between when branches in formatDefault() method
• Consolidate when expression to single-line format per ktlint rules

featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/ConfigParamGenerator.kt


2. featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/ProguardRulesGenerator.kt Formatting +3/-1

Reformat inline comment to separate line

• Move inline comment to separate line above the code it describes
• Add blank line after comment for proper spacing
• Maintain functional behavior while improving code style

featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/ProguardRulesGenerator.kt


3. featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/R8EliminationTest.kt Formatting +104/-83

Fix formatting in test class and bytecode generation

• Remove blank line after class declaration in R8EliminationTest
• Reformat multi-line method parameters with proper indentation
• Adjust method chain indentation for safeClassWriter() calls
• Add trailing commas to multi-line function arguments
• Fix indentation in nested apply blocks for bytecode generation methods

featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/R8EliminationTest.kt


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Apr 3, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: submit-gradle

Failed stage: submit-dependency-snapshot [❌]

Failed test name: ""

Failure summary:

The action failed during Gradle dependency submission (GitHub dependency graph upload), not during
the build/tests.
- The workflow attempted to validate a Gradle project in the repository root and
would exit 1 if validation failed (lines 199-213), but later logs show a successful Gradle build and
dependency graph generation, so this was not the terminal failure.
- The dependency graph JSON was
generated and uploaded as an artifact successfully (lines 328-337).
- The action then failed when
submitting that dependency graph to GitHub: HttpError: Dependency submission failed ... Server Error
(lines 338-342), originating from .../dist/dependency-submission/main/index.js:47566:21. This
indicates a server-side error from the dependency submission API rather than a code/test failure in
the repository.

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

193:  Received 260046848 of 411880995 (63.1%), 123.9 MBs/sec
194:  Received 411880995 of 411880995 (100.0%), 138.1 MBs/sec
195:  Cache Size: ~393 MB (411880995 B)
196:  [command]/usr/bin/tar -xf /home/runner/work/_temp/a3413ec5-5eeb-4618-bdfe-9cdf319a6f7c/cache.tzst -P -C /home/runner/work/Featured/Featured --use-compress-program unzstd
197:  Cache restored successfully
198:  Cache restored from key: Linux-jdk21-temurin-gradle-55bf01419e2ae5ecdb9a1c4e9e8ea774aff3f1ef415478bfa862f4604213282e
199:  ##[group]Run if ./gradlew help; then
200:  �[36;1mif ./gradlew help; then�[0m
201:  �[36;1m  echo "::debug::Gradle validate repository root is a Gradle project with wrapper."�[0m
202:  �[36;1m  echo "{valid-project}={true}" >> "$GITHUB_OUTPUT"�[0m
203:  �[36;1melif gradle help; then�[0m
204:  �[36;1m  echo "::debug::Gradle validate repository root is a Gradle project."�[0m
205:  �[36;1m  echo "{valid-project}={true}" >> "$GITHUB_OUTPUT"�[0m
206:  �[36;1melse�[0m
207:  �[36;1m  echo "{valid-project}={false}" >> "$GITHUB_OUTPUT"�[0m
208:  �[36;1m  echo "### :warning: Gradle validation failed in repository root" >> $GITHUB_STEP_SUMMARY�[0m
209:  �[36;1m  echo "We were unable to validate a Gradle project in the repository root. If your repository requires additional setup steps, you may need to check in your own workflow." >> $GITHUB_STEP_SUMMARY�[0m
210:  �[36;1m  echo "" >> $GITHUB_STEP_SUMMARY�[0m
211:  �[36;1m  echo "For more information on submitting Gradle dependencies from your own workflow, refer to [the submission action](https://github.com/gradle/actions)" >> $GITHUB_STEP_SUMMARY�[0m
212:  �[36;1m  echo "::warning:: Gradle validation failed in the repository root."�[0m
213:  �[36;1m  exit 1�[0m
...

323:  You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
324:  For more on this, please refer to https://docs.gradle.org/9.4.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
325:  BUILD SUCCESSFUL in 10s
326:  19 actionable tasks: 19 executed
327:  Configuration cache entry stored.
328:  Found dependency graph files: /home/runner/work/Featured/Featured/dependency-graph-reports/dynamicdependency-graphauto-submission-submit-gradle.json
329:  Uploading dependency graph file: dependency-graph-reports/dynamicdependency-graphauto-submission-submit-gradle.json
330:  Artifact name is valid!
331:  Root directory input is valid!
332:  Beginning upload of artifact content to blob storage
333:  Uploaded bytes 33422
334:  Finished uploading artifact content to blob storage!
335:  SHA256 digest of uploaded artifact zip is b933d14d2f1057612f7a0ae20a0fce052ae488e39363a284439bad02dcf431ae
336:  Finalizing artifact upload
337:  Artifact dependency-graph_dynamicdependency-graphauto-submission-submit-gradle.json.zip successfully finalized. Artifact ID 6255768539
338:  ##[error]HttpError: Dependency submission failed for dependency-graph-reports/dynamicdependency-graphauto-submission-submit-gradle.json.
339:  Server Error
340:  HttpError: Dependency submission failed for dependency-graph-reports/dynamicdependency-graphauto-submission-submit-gradle.json.
341:  Server Error
342:  at /home/runner/work/_actions/actions/gradle-build-tools-actions/8379f6a1328ee0e06e2bb424dadb7b159856a326/dist/dependency-submission/main/index.js:47566:21

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Applies Spotless/ktlint formatting fixes to the Featured Gradle plugin code and tests to unblock CI checks (notably “Lint & API Check”) that are currently failing due to style violations.

Changes:

  • Reformats R8EliminationTest to satisfy ktlint (parameter wrapping, trailing commas, chaining layout).
  • Adjusts whitespace/comment placement in ProguardRulesGenerator to comply with ktlint rules.
  • Removes extra blank lines in ConfigParamGenerator’s when expression formatting.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/R8EliminationTest.kt Formatting-only refactor of the R8 elimination test helpers and invocations.
featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/ProguardRulesGenerator.kt Minor formatting/comment placement change in proguardLiteral’s when block.
featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/ConfigParamGenerator.kt Removes unnecessary blank lines within formatDefault() for ktlint compliance.

@kirich1409 kirich1409 merged commit 71756ba into main Apr 3, 2026
9 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants