This style guide defines specific coding standards and advice for this Java codebase. The rules here are extensions to the Google Java Style Guide.
Please see the contributing guide for general guidance for contributing to this project.
Automatic formatting should be performed with ./gradlew goJF or ./mvnw fmt:format. Formatting all projects can be done with ./build.sh format.
Extends 3.4.2
Class members should be in the following order, in decreasing priority:
- Static before non-static
- Nested classes/interfaces before fields before constructors before methods
- Public before private
- Final before non-final
User-facing methods (such as those in Jib Core) should not have types in their signature that are not standard JDK classes. For example, a parameter should take type List rather than Guava's ImmutableList.
Packages should depend on each other without cycles.
The following is a list of current jib-core packages (under com.google.cloud.tools.jib) and their immediate dependencies. These can be amended as code changes, but there should not be cyclical dependencies.
apiasyncblob-filesystem,hash,image(cycle - should fix)builder-async,blob,builder,cacheconfiguration,docker,event,filesystem,global,http,image,json,registrycache-blob,filesystem,hash,image,jsonconfiguration-cache,filesystem,event,image,registrydocker-blob,cache,image,json,tareventfilesystemfrontend-configuration,event,filesystem,image,registryglobalhash-blob,imagehttp-blobimage-blob,configuration(cycle - should fix -ImageToJsonTranslator),filesystem,json,tarjson-blobregistry-blob,builder(cycle - should fix -RegistryClient),configuration(cycle - should fix -DockerConfigCredentialRetriever),event,global,http,image,jsontar-blob