awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
ambv avatar

ambv/black

0
View on GitHub↗
41,560 星标·2,779 分支·Python·MIT·7 次浏览black.readthedocs.io/en/stable↗

Black

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 style enforcement across entire projects, and the use of configuration files to define line lengths and excluded file patterns. It further verifies code integrity by comparing the abstract syntax trees of the original and reformatted code to ensure functional equivalence.

Features

  • Deterministic Formatters - Employs a deterministic engine that produces a single consistent output for any given input.
  • Code Formatting - Provides automatic code formatting and style enforcement specifically for the Python language.
  • AST Transformation Tools - Uses abstract syntax tree analysis to restructure code layout without altering functional logic.
  • AST-Based Formatters - Analyzes the Python abstract syntax tree to ensure functional logic remains unchanged while altering code layout.
  • Equivalence Verifiers - Compares the AST of original and reformatted code to ensure no functional changes were introduced.
  • Code Formatters - Automatically adjusts Python source code structure and style to maintain a consistent, deterministic appearance.
  • Concrete Syntax Tree Generators - Utilizes concrete syntax trees to ensure formatting preserves all necessary structural information during the round-trip.
  • Python Source Formatters - Automatically reformats Python source files in place to ensure consistency with a standardized style guide.
  • Equivalence Verifiers - Verifies that generated code maintains functional and structural parity with the original source using AST comparison.
  • Coding Standards Enforcement - Provides an automated system for maintaining project guidelines and eliminating debates over code layout.
  • Deterministic Style Standards - Enforces a deterministic style to ensure a uniform appearance and reduce noise during version control reviews.
  • Style Guide Enforcers - Eliminates manual style debates by enforcing a single, deterministic standard across all Python files.
  • Notebook Formatters - Applies consistent styling and formatting to interactive Jupyter notebook files.
  • Notebook Formatting Tools - Applies consistent code formatting to individual cells within Jupyter notebook files.
  • In-Place File Mutators - Writes reformatted content directly back to the source files to update the codebase on disk.
  • Style-Based Diff Cleanup - Removes stylistic noise from git diffs by ensuring all code follows a deterministic and uniform format.
  • Formatter Rule Schemas - Provides the ability to define project-specific defaults and file patterns via a configuration file.
  • Formatter Configurations - Supports external configuration files to define project-specific line lengths and excluded patterns.
  • Code Editors and IDEs - Uncompromising automatic formatter for Python source code.

Star 历史

ambv/black 的 Star 历史图表ambv/black 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

ambv/black 是做什么的?

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.

ambv/black 的主要功能有哪些?

ambv/black 的主要功能包括:Deterministic Formatters, Code Formatting, AST Transformation Tools, AST-Based Formatters, Equivalence Verifiers, Code Formatters, Concrete Syntax Tree Generators, Python Source Formatters。

ambv/black 有哪些开源替代品?

ambv/black 的开源替代品包括: dprint/dprint — dprint is a multi-language code formatter that applies consistent styling across various programming languages using a… raywenderlich/swift-style-guide — This project is a collection of Swift coding standards and static analysis rules designed to ensure consistency across… xojs/xo — xo is a zero-configuration linting tool for JavaScript and TypeScript. It functions as a wrapper for the ESLint… google/yapf — YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete… psf/black — This project is an uncompromising, deterministic code formatter for Python. It functions by parsing source code into… bbatsov/rubocop — RuboCop is a static code analyzer and linter for Ruby. It functions as a static analysis tool designed to detect…

Black 的开源替代方案

相似的开源项目,按与 Black 的功能重合度排序。
  • dprint/dprintdprint 的头像

    dprint/dprint

    3,795在 GitHub 上查看↗

    dprint is a multi-language code formatter that applies consistent styling across various programming languages using a pluggable architecture. It functions as a unified project style management tool, a command-line interface for continuous integration style enforcement, and a Language Server Protocol implementation for real-time formatting in editors. The project is distinguished by a WebAssembly-based plugin system that loads sandboxed formatting logic from URLs or file paths. It further extends its capabilities through a process-based tool integration that wraps external command-line interf

    Rustformatter
    在 GitHub 上查看↗3,795
  • raywenderlich/swift-style-guideraywenderlich 的头像

    raywenderlich/swift-style-guide

    13,173在 GitHub 上查看↗

    This project is a collection of Swift coding standards and static analysis rules designed to ensure consistency across Swift projects. It provides a defined set of naming conventions and structural guidelines to maintain a shared style for teams. The repository centers on a SwiftLint configuration used to automate the detection and correction of style violations in source code. This configuration enables automated style enforcement, ensuring that code adheres to organizational standards without requiring manual review. The guidelines cover the standardization of code formatting, naming, and

    在 GitHub 上查看↗13,173
  • xojs/xoxojs 的头像

    xojs/xo

    7,977在 GitHub 上查看↗

    xo is a zero-configuration linting tool for JavaScript and TypeScript. It functions as a wrapper for the ESLint engine, providing a set of strict default rules and static analysis to enforce professional coding standards without requiring manual configuration files. The tool distinguishes itself by providing a zero-config runtime that automatically determines parser settings and linting rules at execution time. It includes a code style formatter to standardize indentation and syntax across all project files. The project covers automated error correction and source code formatting to eliminat

    TypeScript
    在 GitHub 上查看↗7,977
  • google/yapfgoogle 的头像

    google/yapf

    13,978在 GitHub 上查看↗

    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 proce

    Python
    在 GitHub 上查看↗13,978
  • 查看 Black 的所有 30 个替代方案→