Skip to content

Improvement/spotless#90

Merged
mattknatt merged 2 commits into
mainfrom
improvement/spotless
Apr 23, 2026
Merged

Improvement/spotless#90
mattknatt merged 2 commits into
mainfrom
improvement/spotless

Conversation

@mattknatt

@mattknatt mattknatt commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • Chores
    • Integrated automated code formatting checks into the CI/CD pipeline using Spotless
    • Applied code formatting standards across the project, including unused import removal, annotation consolidation, and whitespace normalization

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds the Spotless Maven plugin for code formatting verification and applies formatting cleanup across the codebase, including removing unused imports, consolidating annotations onto single lines, and normalizing trailing whitespace throughout the project.

Changes

Cohort / File(s) Summary
CI/Build Configuration
.github/workflows/ci.yml, pom.xml
Introduces Spotless Maven plugin version 2.46.1 with Java-only formatting rules; adds spotless:check verification step to CI workflow after standard build/test.
Service Layer
src/main/java/org/example/projektarendehantering/application/service/CaseService.java, src/main/java/org/example/projektarendehantering/application/service/DocumentService.java
Removes unused validation import from CaseService; reformats ObjectMetadata builder call whitespace in DocumentService.
Infrastructure/Security
src/main/java/org/example/projektarendehantering/infrastructure/config/SecurityConfig.java, src/main/java/org/example/projektarendehantering/infrastructure/security/CustomOAuth2UserService.java
Removes unused Spring Security imports; normalizes whitespace in DefaultOAuth2User constructor call.
JPA Entities
src/main/java/org/example/projektarendehantering/infrastructure/persistence/AuditEventEntity.java, src/main/java/org/example/projektarendehantering/infrastructure/persistence/EmployeeEntity.java, src/main/java/org/example/projektarendehantering/infrastructure/persistence/UserAccountEntity.java
Removes unused JPA annotation imports; reformats field annotations to single-line declarations where applicable.
DTOs
src/main/java/org/example/projektarendehantering/presentation/dto/CreateCaseForm.java, src/main/java/org/example/projektarendehantering/presentation/dto/EmployeeCreateDTO.java, src/main/java/org/example/projektarendehantering/presentation/dto/EmployeeUpdateDTO.java, src/main/java/org/example/projektarendehantering/presentation/dto/PatientCreateDTO.java, src/main/java/org/example/projektarendehantering/presentation/dto/PatientDTO.java, src/main/java/org/example/projektarendehantering/presentation/dto/PatientRegistrationDTO.java, src/main/java/org/example/projektarendehantering/presentation/dto/PatientUpdateDTO.java, src/main/java/org/example/projektarendehantering/presentation/dto/UpdateCaseForm.java
Consolidates validation annotations onto single lines with field declarations; no constraint or validation logic changes.
Web Controllers
src/main/java/org/example/projektarendehantering/presentation/web/GlobalControllerAdvice.java, src/main/java/org/example/projektarendehantering/presentation/web/PatientUiController.java, src/main/java/org/example/projektarendehantering/presentation/web/UiController.java
Normalizes whitespace and trailing blank lines; adds missing final newline to UiController.
Tests
src/test/java/.../AuditIntegrationTest.java, src/test/java/.../DocumentIntegrationTest.java, src/test/java/.../ProjektArendehanteringApplicationTests.java, src/test/java/.../AuditServiceTest.java, src/test/java/.../CaseServiceTest.java, src/test/java/.../PatientServiceTest.java, src/test/java/.../CustomOAuth2UserServiceTest.java, src/test/java/.../SecurityActorAdapterTest.java, src/test/java/.../AuditControllerTest.java, src/test/java/.../EmployeeUiControllerTest.java, src/test/java/.../UiControllerTest.java
Removes unused imports across multiple test files; normalizes whitespace and removes trailing spaces from blank lines throughout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • OskarLundqvist33

Poem

🐰✨ Spotless paths through tangled code,
Formatting fixed along the road,
Imports trimmed and whitespace clean,
The neatest Java ever seen!
Comma dances, single lines,
Your code now shines! ⭐

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Improvement/spotless' is vague and generic, using non-descriptive terms that don't clearly convey what changes were made to the codebase. Use a more descriptive title that clarifies the main change, such as 'Add Spotless code formatting plugin and apply formatting cleanup' or 'Configure Spotless Maven plugin and enforce code style.'
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improvement/spotless

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.

@mattknatt
mattknatt merged commit ef724aa into main Apr 23, 2026
1 of 2 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.

1 participant