Add linter to project and workflows#8
Merged
XavierJCallait merged 32 commits intomainfrom Aug 5, 2025
Merged
Conversation
…up of application
There was a problem hiding this comment.
Pull Request Overview
This PR integrates code formatting and linting tools into the project to enforce consistent code style and catch potential bugs. The primary change is adding Spotless formatter with Google Java Format and SpotBugs linter, along with necessary workflow updates.
- Added Spotless and SpotBugs Maven plugins to pom.xml for code formatting and static analysis
- Reformatted all existing Java files to comply with Google Java Format standards
- Restructured GitHub Actions workflows to include formatting/linting checks before verification
Reviewed Changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Added Spotless and SpotBugs plugins with configuration |
| .github/workflows/format-lint.yml | New workflow for running formatter and linter checks |
| .github/workflows/verify-run.yml | Updated to be callable by other workflows |
| .github/workflows/linter.yml | Removed old linter workflow |
| .github/actions/setup-env/action.yml | New reusable action for Java/Maven setup |
| src/main/java/util/HibernateUtil.java | Reformatted and updated API to return Session instead of SessionFactory |
| src/main/java/util/EnvironmentVariableInitializer.java | Reformatted and fixed defensive copying in getter |
| src/main/java/util/DatabaseManager.java | Reformatted and improved resource management |
| src/main/java/util/AppShutdown.java | Reformatted and updated method name from Shutdown to shutdown |
| src/main/java/service/Inventory.java | Reformatted and changed static fields to instance fields |
| src/main/java/model/* | Reformatted constructor parameters for better readability |
| src/main/java/app/InventoryApp.java | Reformatted and added sample product manipulation code |
| src/test/java/* | Reformatted import statements and javadoc comments |
| README.md | Updated with better documentation of Maven commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added spotless formatter for now. Configured to use the Google-Java-Format.