# google/google-java-format

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/google-google-java-format).**

6,145 stars · 919 forks · Java · NOASSERTION

## Links

- GitHub: https://github.com/google/google-java-format
- awesome-repositories: https://awesome-repositories.com/repository/google-google-java-format.md

## Description

google-java-format is a Java code formatter and style enforcement tool. It reformats Java source code to adhere to a standardized style guide, ensuring consistent layout and indentation across entire projects or individual files.

The project functions as a build pipeline linting tool for continuous integration workflows and as an IDE formatting plugin to replace native editor formatting. It can be embedded as a formatting library within code generation software to ensure machine-written output remains human-readable.

The tool provides capabilities for reorganizing source code indentation and spacing, including the ability to apply formatting selectively to specific line ranges or modified diffs. It supports integration with development editors like Eclipse to automate layout updates during the coding process.

## Tags

### Programming Languages & Runtimes

- [Formatting Engines](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/source-code-templates/source-code-transformation-engines/java-source-code-transformers/formatting-engines.md) — Provides a comprehensive engine for formatting Java source code to a standardized layout. ([source](https://github.com/google/google-java-format#readme))
- [Source Code Formatters](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-formatters.md) — Automatically rewrites Java source code to adhere to a standardized style guide for consistent layout and indentation.
- [Diff-Aware Formatting](https://awesome-repositories.com/f/programming-languages-runtimes/diff-aware-formatting.md) — Supports diff-aware formatting to apply style updates only to modified lines in a file. ([source](https://github.com/google/google-java-format#readme))
- [Token Stream Converters](https://awesome-repositories.com/f/programming-languages-runtimes/lexical-token-streams/token-stream-converters.md) — Utilizes token stream converters to process raw characters into tokens for precise indentation control.

### Part of an Awesome List

- [Source Code Formatters](https://awesome-repositories.com/f/awesome-lists/devtools/code-analysis-and-formatting/source-code-formatters.md) — Automatically restructures Java source code to adhere to a consistent visual style and layout. ([source](https://github.com/google/google-java-format#readme))
- [Static Analysis Tools](https://awesome-repositories.com/f/awesome-lists/devtools/static-analysis-tools.md) — Reformats Java code to Google Style.

### Development Tools & Productivity

- [Source Code Rewriting](https://awesome-repositories.com/f/development-tools-productivity/ast-transformation-tools/ast-to-source-conversion/source-code-rewriting.md) — Rewrites whole Java documents or specific offsets to correct style violations based on structural analysis. ([source](https://github.com/google/google-java-format/blob/master/README.md))
- [Coding Style Tools](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/developer-tools/code-quality-verification/coding-style-tools.md) — Provides tools to enforce consistent coding style and layout across Java projects.
- [AST-Based Source Transformations](https://awesome-repositories.com/f/development-tools-productivity/ast-transformation-tools/ast-to-source-conversion/ast-based-source-transformations.md) — Uses abstract syntax tree transformations to rewrite Java source code while preserving semantic meaning.
- [Editor Formatting Integrations](https://awesome-repositories.com/f/development-tools-productivity/code-editors-ides/extension-ecosystems-management/editor-extensions/editor-integrations/editor-formatting-integrations.md) — Integrates with editors to replace native formatting actions with a standardized style. ([source](https://github.com/google/google-java-format/blob/master/README.md))
- [Code Formatters](https://awesome-repositories.com/f/development-tools-productivity/ide-integration-plugins/code-formatters.md) — Provides an IDE plugin that replaces native formatting with a standardized Java style guide.
- [Build Pipeline Integrations](https://awesome-repositories.com/f/development-tools-productivity/workflow-automation-tools/build-task-automation/build-pipeline-integrations.md) — Integrates formatting verification into continuous integration and build pipelines. ([source](https://github.com/google/google-java-format#readme))

### Software Engineering & Architecture

- [Layout Formatters](https://awesome-repositories.com/f/software-engineering-architecture/dotnet-code-style-standards/java-coding-standards/layout-formatters.md) — Standardizes Java source code layout and style for consistency and readability across organizations.
- [Style Rule Sets](https://awesome-repositories.com/f/software-engineering-architecture/schema-validated-rule-sets/pluggable-rule-sets/style-rule-sets.md) — Enforces a fixed set of layout constraints and spacing standards via style rule sets.
- [Style Guide Enforcers](https://awesome-repositories.com/f/software-engineering-architecture/style-guide-enforcers.md) — Automates the application of a strict, singular Java coding style to ensure consistency across entire projects.
- [Lossless Semantic Trees](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-tools/internal-tree-representations/lossless-semantic-trees.md) — Implements lossless semantic trees to ensure comments and whitespace are preserved during reformatting.
- [Surgical Code Refactoring](https://awesome-repositories.com/f/software-engineering-architecture/surgical-code-refactoring.md) — Allows for surgical code modifications by applying style updates only to specific line ranges.

### Data & Databases

- [Recursive Descent Parsers](https://awesome-repositories.com/f/data-databases/data-transformation-functions/recursive-processors/recursive-logic-implementations/recursive-descent-parsers.md) — Employs recursive descent parsing to break down Java source code into structural boundaries.

### DevOps & Infrastructure

- [Continuous Integration Checks](https://awesome-repositories.com/f/devops-infrastructure/continuous-integration-pipelines/continuous-integration-checks.md) — Automates formatting and style checks as part of a continuous integration pipeline.

### Testing & Quality Assurance

- [Formatting and Linting Pipelines](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-quality-tools/formatting-and-linting-pipelines.md) — Functions as a formatting and linting pipeline to ensure code meets style requirements before merging.
