{"id":21877648,"url":"https://github.com/rbiedrawa/java-gradle-codestyle-setup","last_synced_at":"2025-03-21T23:43:17.222Z","repository":{"id":162193099,"uuid":"454807307","full_name":"rbiedrawa/java-gradle-codestyle-setup","owner":"rbiedrawa","description":"Reference project template with code style settings for Java / Gradle projects","archived":false,"fork":false,"pushed_at":"2022-03-24T11:24:13.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T18:17:20.993Z","etag":null,"topics":["git-hooks","google-java-format","gradle","intelij","palantir","spotless","spotless-gradle","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbiedrawa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-02T14:28:45.000Z","updated_at":"2022-11-30T07:31:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d255c80-3093-4a2f-806a-353424be3721","html_url":"https://github.com/rbiedrawa/java-gradle-codestyle-setup","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbiedrawa%2Fjava-gradle-codestyle-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbiedrawa%2Fjava-gradle-codestyle-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbiedrawa%2Fjava-gradle-codestyle-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbiedrawa%2Fjava-gradle-codestyle-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbiedrawa","download_url":"https://codeload.github.com/rbiedrawa/java-gradle-codestyle-setup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885531,"owners_count":20526293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git-hooks","google-java-format","gradle","intelij","palantir","spotless","spotless-gradle","spring-boot"],"created_at":"2024-11-28T08:09:52.753Z","updated_at":"2025-03-21T23:43:17.213Z","avatar_url":"https://github.com/rbiedrawa.png","language":"Java","readme":"# Reference project template with code style settings for Java / Gradle projects\n\nThis repository contains code style settings that can be used to ensure formatting consistency inside Java / Gradle projects.\n\nProject is configured to use [Spotless](https://github.com/diffplug/spotless) with [Palantir java format](https://github.com/palantir/palantir-java-format) which is based on\nthe [Google java format](https://github.com/google/google-java-format).\n\n# Getting Started\n\n## Usage\n\n### Gradle\n\nUse below command to apply `Spotless` code formatting steps\n\n```shell\n./gradlew spotlessApply\n```\n\n### Git (pre-commit Hook)\n\nRun `spotlessApply` automatically on every commit.\n\n#### Installation:\n\n1. Install pre-commit\n\t```shell\n\tbrew install pre-commit\n\t```\n2. Open new terminal and go to **project** directory\n3. Install pre-commit hook using [.pre-commit-config.yaml](./.pre-commit-config.yaml)\n\t```shell\n\tpre-commit install\n\t```\n\n#### Uninstall:\n\n```shell\nrm ./.git/hooks/pre-commit\n```\n\n### Intelij plugin\n\n#### Installation:\n\nA [palantir-java-format IntelliJ plugin](https://plugins.jetbrains.com/plugin/13180-palantir-java-format/)\nis available from the plugin repository. To install it, go to your IDE's settings and select the `Plugins` category.\nClick the `Marketplace` tab, search for the `palantir-java-format` plugin, and click the `Install` button.\n\n#### Usage:\n\nThe plugin will be disabled by default on new projects but if using the `com.palantir.java-format` gradle plugin, it\nwill be recommended in IntelliJ and automatically configured.\n\nTo manually enable it in the current project, go to `File→Settings...→palantir-java-format Settings` (\nor `IntelliJ IDEA→Preferences...→Other Settings→palantir-java-format Settings` on macOS) and check\nthe `Enable palantir-java-format` checkbox.\n\nWhen enabled, it will replace the normal `Reformat Code` action, which can be triggered from the `Code` menu or with the\nCtrl-Alt-L (by default) keyboard shortcut.\n\n#### Caution:\n\nCustom [codeStyles](./.idea/codeStyles) settings are stored inside this repository and they will be used automatically, in order to ensure correct import orders and other formatting rules inside Intelij IDE.\n\n## References\n\n* [Spotless gradle plugin](https://github.com/diffplug/spotless/tree/main/plugin-gradle)\n* [Pre-commit](https://pre-commit.com/#usage)\n* [Palantir Java Format plugin](https://github.com/palantir/palantir-java-format)\n* [Intelij Palantir Java Format plugin](https://plugins.jetbrains.com/plugin/13180-palantir-java-format/)\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbiedrawa%2Fjava-gradle-codestyle-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbiedrawa%2Fjava-gradle-codestyle-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbiedrawa%2Fjava-gradle-codestyle-setup/lists"}