awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
google avatar

google/yapf

0
View on GitHub↗
13,978 stars·902 forks·Python·Apache-2.0·25 views

Yapf

YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete syntax trees to ensure structural consistency and a uniform visual presentation across source files.

The engine utilizes a penalty-based layout optimizer to determine the best line breaks by calculating numerical costs for different formatting choices. It employs a multi-process code processor to distribute the formatting of multiple files across several CPU cores.

The tool covers source code reformatting through in-place file modifications, difference analysis, and the processing of partial code fragments. It includes a rule-based configuration system for managing style presets, layout rules, and project-level settings.

Integration capabilities include style compliance verification for continuous integration pipelines, git hook automation, and editor-based format-on-save functionality.

Features

  • Python Code Formatters - Reformats Python source code to adhere to defined style guides for consistent visual presentation.
  • Penalty-Based Layout Optimizers - Implements a penalty-based layout optimizer to determine the most aesthetically pleasing line breaks based on numerical costs.
  • Formatting Processors - Employs a recursive descent pattern to traverse the code tree and determine the optimal layout of nested elements.
  • AST-Based Formatters - Uses concrete syntax tree analysis to restructure code layout while preserving functional logic.
  • Style Rule Configurations - Provides a rule-based configuration system for defining how specific Python constructs should be formatted.
  • Python Development Tools - Provides productivity utilities for the Python ecosystem, including automatic code reformatting.
  • Layout Rule Definitions - Defines specific layout rules for indentation and line length to ensure visual consistency.
  • Source Code Formatters - Automatically reformats Python source code to adhere to a standardized style guide for consistent presentation.
  • Style Compliance Checkers - Includes a check-only mode to verify style compliance without modifying files, suitable for continuous integration pipelines.
  • Project Configuration Management - Manages formatting and ignore configurations at the project level to ensure consistency across teams.
  • Concrete Syntax Tree Transformations - Reconstructs source code by modifying concrete syntax tree representations while preserving the original structural integrity.
  • Formatting Behavior Adjustments - Adjusts the layout behavior for Python expressions, lists, and dictionaries using style flags and penalties.
  • Git Style Verifiers - Verifies style compliance within git diffs and automates formatting during commit events.
  • In-Place File Mutators - Supports updating source files directly on disk with the reformatted version.
  • Large-Scale Style Maintenance - Maintains consistent formatting and style across extremely large software repositories using parallel processing.
  • Concrete Syntax Tree Generators - Uses concrete syntax trees to maintain high fidelity to the original source code structure during the formatting process.
  • Continuous Integration Checks - Executes formatting checks within automated pipelines to identify style violations during pull requests.
  • Formatting Exclusion Markers - Provides inline markers that allow developers to exclude specific blocks of code from being reformatted.
  • Multi-Process Parallelism - Utilizes multi-process parallelism to distribute the formatting workload across multiple CPU cores for faster execution on large projects.
  • Partial Fragment Formatting - Processes specific line ranges or fragments of code to support targeted formatting updates.
  • Parallel Processing - Improves performance by distributing the formatting of multiple Python files across several CPU cores.
  • Style Presets - Provides named style presets and configuration files to control code indentation and spacing.
  • Textual Difference Analysis - Identifies textual differences between the current source and the proposed formatted version without applying changes.
  • Code Formatters - Configurable formatter that reformats code to follow best practices.

Star history

Star history chart for google/yapfStar history chart for google/yapf

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does google/yapf do?

YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete syntax trees to ensure structural consistency and a uniform visual presentation across source files.

What are the main features of google/yapf?

The main features of google/yapf are: Python Code Formatters, Penalty-Based Layout Optimizers, Formatting Processors, AST-Based Formatters, Style Rule Configurations, Python Development Tools, Layout Rule Definitions, Source Code Formatters.

What are some open-source alternatives to google/yapf?

Open-source alternatives to google/yapf include: psf/black — This project is an uncompromising, deterministic code formatter for Python. It functions by parsing source code into… rust-lang/rustfmt — rustfmt is a Rust code formatter that operates as a Cargo subcommand, applying consistent formatting to Rust source… hhatto/autopep8 — autopep8 is a Python static code styler and formatter designed to automatically rewrite source code to comply with the… ambv/black — Black is a deterministic Python code formatter and style guide enforcer. It automatically reformats source code and… google/google-java-format — google-java-format is a Java code formatter and style enforcement tool. It reformats Java source code to adhere to a… google/vim-codefmt — Vim-codefmt is a plugin for the Vim text editor that automates source code formatting by integrating external…

Open-source alternatives to Yapf

Similar open-source projects, ranked by how many features they share with Yapf.
  • psf/blackpsf avatar

    psf/black

    41,578View on GitHub↗

    This project is an uncompromising, deterministic code formatter for Python. It functions by parsing source code into an abstract syntax tree and regenerating it according to a rigid, opinionated set of style rules. By automating the formatting process, it eliminates manual style debates and configuration overhead, ensuring that code remains consistent across entire projects regardless of the original input. The tool distinguishes itself through its focus on speed and seamless integration into development workflows. It utilizes content-based file caching and parallel processing to maintain hig

    Pythonautopep8codecodeformatter
    View on GitHub↗41,578
  • rust-lang/rustfmtrust-lang avatar

    rust-lang/rustfmt

    6,747View on GitHub↗

    rustfmt is a Rust code formatter that operates as a Cargo subcommand, applying consistent formatting to Rust source files according to official style guidelines. It parses source code into a syntax tree, applies formatting rules to tree nodes, and pretty-prints the result back to text, with support for TOML-driven configuration that allows per-project style customization. The formatter is edition-aware, automatically selecting formatting rules based on the Rust edition specified in the project, and supports a style edition override that decouples formatting rules from the Rust edition used fo

    Rustcodeformatterformatterrust
    View on GitHub↗6,747
  • hhatto/autopep8hhatto avatar

    hhatto/autopep8

    4,665View on GitHub↗

    autopep8 is a Python static code styler and formatter designed to automatically rewrite source code to comply with the PEP 8 style guide. It functions as a recursive code cleaner that identifies and fixes indentation, whitespace, and syntax irregularities across entire projects. The tool performs structural refactoring using abstract syntax tree transformations to execute non-whitespace changes, such as shortening long lines and improving identity tests. It includes an aggressive refactoring mode for complex style violations and supports selective formatting via inline markers to disable chan

    Python
    View on GitHub↗4,665
  • ambv/blackambv avatar

    ambv/black

    41,560View on GitHub↗

    Black is a deterministic Python code formatter and style guide enforcer. It automatically reformats source code and Jupyter notebook cells into a consistent style to eliminate manual debates over code layout and reduce noise in version control diffs. The tool uses abstract syntax tree analysis to restructure code layout while ensuring that the underlying functional logic remains unchanged. It employs a deterministic engine that produces a single consistent output for any given input, removing subjective styling choices. The system provides capabilities for in-place file mutation, automated s

    Python
    View on GitHub↗41,560
  • See all 30 alternatives to Yapf→