{"id":19249020,"url":"https://github.com/sbt/sbt-java-formatter","last_synced_at":"2025-04-21T12:30:56.295Z","repository":{"id":9713362,"uuid":"47744636","full_name":"sbt/sbt-java-formatter","owner":"sbt","description":"An sbt plugin for formating Java code","archived":false,"fork":false,"pushed_at":"2025-04-09T20:04:53.000Z","size":186,"stargazers_count":29,"open_issues_count":5,"forks_count":29,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-04-09T20:30:53.107Z","etag":null,"topics":["code-formatter","java","sbt"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-12-10T07:15:01.000Z","updated_at":"2025-04-09T20:04:57.000Z","dependencies_parsed_at":"2024-11-09T18:12:11.148Z","dependency_job_id":null,"html_url":"https://github.com/sbt/sbt-java-formatter","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-java-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-java-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-java-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-java-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbt","download_url":"https://codeload.github.com/sbt/sbt-java-formatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250055913,"owners_count":21367453,"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":["code-formatter","java","sbt"],"created_at":"2024-11-09T18:12:06.863Z","updated_at":"2025-04-21T12:30:56.267Z","avatar_url":"https://github.com/sbt.png","language":"Scala","readme":"# [sbt-java-formatter][] [![scaladex-badge][]][scaladex]\n\n[sbt-java-formatter]: https://github.com/sbt/sbt-java-formatter\n[scaladex]:           https://index.scala-lang.org/sbt/sbt-java-formatter\n[scaladex-badge]:     https://index.scala-lang.org/sbt/sbt-java-formatter/latest.svg\n\nAn sbt plugin for formatting Java code. This plugin began as a combination of ideas from this\n[blog post](https://ssscripting.wordpress.com/2009/06/10/how-to-use-the-eclipse-code-formatter-from-your-code/)\nand this [maven plugin](https://github.com/revelc/formatter-maven-plugin), though it has evolved since.\n\n# Usage\n\nAdd the plugin to `project/plugins.sbt`:\n\n```scala\naddSbtPlugin(\"com.github.sbt\" % \"sbt-java-formatter\" % --latest version---)\n```\n\nFor available versions see [releases](https://github.com/sbt/sbt-java-formatter/releases).\n\n* `javafmt` formats Java files\n* `javafmtAll` formats Java files for all configurations (`Compile` and `Test` by default)\n* `javafmtCheck` fails if files need reformatting\n* `javafmtCheckAll` fails if files need reformatting in any configuration (`Compile` and `Test` by default)\n\n* The `javafmtOnCompile` setting controls whether the formatter kicks in on compile (`false` by default).\n* The `javafmtStyle` setting defines the formatting style: Google Java Style (by default) or AOSP style.\n\nThis plugin requires sbt 1.3.0+.\n\n## Enable in other scopes (eg `IntegrationTest`)\n\nThe sbt plugin is enabled by default for the `Test` and `Compile` configurations. Use `JavaFormatterPlugin.toBeScopedSettings` to enable the plugin for the `IntegrationTest` scope and then use `It/javafmt` to format.\n\n```scala\ninConfig(IntegrationTest)(JavaFormatterPlugin.toBeScopedSettings)\n```\n\n# Configuration\n\nThis plugin uses the [Google Java Format](https://github.com/google/google-java-format) library, which makes it quite opinionated and not particularly configurable.\n\nIf you want to tweak the format, take a minute to consider whether it is really worth it, and have a look at the motivations in the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html).\nIf you decide you really need more flexibility, you could consider other plugins such as the [sbt-checkstyle-plugin](https://github.com/etsy/sbt-checkstyle-plugin)\n\n# Contributing\n\nYes, we'll happily accept PRs to improve the plugin.\n\nTake a look at the [contributors graph](https://github.com/sbt/sbt-java-formatter/graphs/contributors) if you want to contact\nany of the contributors directly.\n\n# License\n\nApache v2\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbt%2Fsbt-java-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbt%2Fsbt-java-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbt%2Fsbt-java-formatter/lists"}