- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6
Google code format #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Well, a bit update. As I said it carries no functional update, the only exception is that  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR introduces Google Java Format to establish consistent code formatting across the entire Java SDK project. The changes are purely cosmetic, applying standardized formatting rules including 2-space indentation (down from 4-space), proper import ordering, consistent line breaks, and trailing newlines. A new Docker Compose service is added to enable automated formatting via docker-compose run format, which downloads and runs Google Java Format v1.30.0 on all Java files. The PR also includes minor dependency updates to align logback versions (both core and classic updated to 1.5.19) and adds documentation in README.md explaining the new formatting standards.
The formatting changes affect 29 Java files across the codebase, touching models, clients, utilities, and test files. All functional logic remains identical - this is exclusively a code style standardization effort implemented while the project is small to minimize future maintenance overhead and allow developers to focus on functionality rather than manual formatting.
Important Files Changed
Changed Files
| Filename | Score | Overview | 
|---|---|---|
| compose.yaml | 3/5 | Adds Docker service for Google Java Format with potential security risk from downloading external JARs | 
| pom.xml | 4/5 | Updates logback dependency versions from mixed versions to aligned 1.5.19, despite PR claiming zero changes | 
| src/main/java/com/infisical/sdk/util/InfisicalException.java | 4/5 | Formatting changes only, but pre-existing design issues with exception handling remain | 
| src/main/java/com/infisical/sdk/resources/SecretsClient.java | 4/5 | Pure formatting changes with clean implementation of secret management operations | 
| README.md | 5/5 | Adds clear documentation for code formatting standards and usage instructions | 
| src/main/java/com/infisical/sdk/InfisicalSdk.java | 5/5 | Main SDK class reformatted with consistent indentation and cleaned up imports | 
| src/main/java/com/infisical/sdk/api/ApiClient.java | 5/5 | HTTP client formatting standardized with no functional changes | 
| src/main/java/com/infisical/sdk/api/QueryBuilder.java | 5/5 | Simple utility class reformatted with consistent 2-space indentation | 
| src/main/java/com/infisical/sdk/config/SdkConfig.java | 5/5 | Configuration class with added trailing newline only | 
| src/main/java/com/infisical/sdk/resources/FoldersClient.java | 5/5 | Folder operations client with cleaned imports and consistent formatting | 
| src/main/java/com/infisical/sdk/util/Helper.java | 5/5 | Utility methods reformatted with standardized spacing and indentation | 
| src/main/java/com/infisical/sdk/util/ObjectToMapConverter.java | 5/5 | Reflection-based converter with consistent formatting applied | 
| src/main/java/com/infisical/sdk/models/*.java(15 files) | 5/5 | All model classes reformatted with consistent 2-space indentation and proper spacing | 
| src/test/java/com/infisical/sdk/InfisicalSdkTest.java | 5/5 | Test class with improved formatting and organized imports | 
| src/test/java/com/infisical/sdk/auth/AwsAuthProviderTest.java | 5/5 | Test file with authorization header string properly split across lines | 
| src/test/java/com/infisical/sdk/util/EnvironmentVariables.java | 5/5 | Test utility with removed unused imports and improved conditional formatting | 
| src/test/java/com/infisical/sdk/util/RandomUtil.java | 5/5 | Random string generator with formatting improvements only | 
Confidence score: 4/5
- This PR is generally safe to merge as it primarily contains formatting changes with minimal functional risk
- Score reflects mostly cosmetic changes but deducted due to dependency updates in pom.xml (despite PR claiming zero changes), potential security risk in compose.yaml downloading external JARs without verification, and pre-existing issues in InfisicalException.java that weren't addressed
- Pay close attention to compose.yaml for security implications and pom.xml for the unexpected dependency version changes
Sequence Diagram
sequenceDiagram
    participant Developer
    participant GoogleJavaFormat
    participant DockerCompose
    participant FileSystem
    Developer->>DockerCompose: "docker-compose run format"
    DockerCompose->>GoogleJavaFormat: "Download google-java-format-1.30.0-all-deps.jar"
    GoogleJavaFormat-->>DockerCompose: "JAR downloaded to /tmp/"
    DockerCompose->>FileSystem: "find . -type f -name \"*.java\""
    FileSystem-->>DockerCompose: "List of Java files"
    DockerCompose->>GoogleJavaFormat: "java -jar google-java-format.jar --replace [files]"
    GoogleJavaFormat->>FileSystem: "Format and replace Java files"
    Note over GoogleJavaFormat,FileSystem: All Java files formatted with Google style
    GoogleJavaFormat-->>DockerCompose: "Formatting complete"
    DockerCompose-->>Developer: "Code formatting finished"
    Additional Comments (1)
- 
src/main/java/com/infisical/sdk/config/SdkConfig.java, line 24 (link)logic: Error message says "Token must be provided" but should reference "Site URL" since this validation is for the siteUrl field 
34 files reviewed, 6 comments
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-core</artifactId> | ||
| <version>1.5.13</version> | ||
| <version>1.5.19</version> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just mentioning, #12.
Updating logback classic and core will resolve this issue too.
| @DanielHougaard can you please have a look at this PR too ? #13, have created a video of it as well. | 
This PR carries zero functional changes. I just add
google-java-formatdocker compose format and then ran it for all current java files. The project is still very small so that the cost to run it is low right now. It would be much easier to maintain down the road, we can write code without thinking much about the style and let the formatter do its job.