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

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

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

hhatto/autopep8

0
View on GitHub↗
4,665 星标·284 分支·Python·MIT·10 次浏览pypi.org/project/autopep8↗

Autopep8

autopep8 是一个 Python 静态代码样式器和格式化程序,旨在自动重写源代码以符合 PEP 8 样式指南。它作为一个递归代码清理器,识别并修复整个项目中的缩进、空格和语法不规范之处。

该工具使用抽象语法树(AST)转换执行结构化重构,以执行非空格更改,例如缩短长行和改进身份测试。它包括用于复杂样式违规的激进重构模式,并支持通过内联标记进行选择性格式化,以禁用特定代码块的更改。

功能包括用于定位或忽略特定错误代码的基于规则的修复过滤、行范围格式化,以及生成样式差异报告。该系统可以通过具有递归目录遍历和原地文件修改的命令行界面处理文件,也可以通过 API 以编程方式集成。

格式化偏好和规则集可以通过全局或本地配置文件进行管理。

Features

  • Python Code Formatters - Automatically reformats Python source code to comply with the PEP 8 style guide.
  • Python Source Formatters - Automatically rewrites Python source code to conform to PEP 8 by fixing indentation and whitespace.
  • Python Style Checkers - Ensures Python code adheres to the official PEP 8 style guide by fixing common syntax and layout irregularities.
  • Automated Lint Fixes - Identifies and automatically fixes style violations across entire directories to maintain a clean codebase.
  • AST-Based Refactoring - Performs structural refactoring using abstract syntax tree transformations to execute non-whitespace changes.
  • Source Code Formatting - Provides a programmatic API for formatting Python source strings to ensure consistent styling and indentation.
  • PEP 8 Rule Detection - Uses a static analysis engine to identify style violations by matching source code against predefined PEP 8 rules.
  • Python Static Analyzers - Identifies and fixes indentation, whitespace, and syntax irregularities using static analysis.
  • AST-Based Source Transformations - Implements structural code changes, such as identity test improvements, by manipulating the Python abstract syntax tree.
  • Automated Code Refactoring - Applies structural changes to Python code, such as improving identity tests, to enhance overall quality.
  • In-Place File Mutators - Overwrites original source files directly on disk with formatted content instead of using standard output.
  • Style Difference Reports - Generates difference reports showing required style changes without modifying the actual source files.
  • Tag-Based Rule Filtering - Targets specific subsets of style errors or ignores particular rules using error codes.
  • Recursive Directory Processing - Functions as a recursive code cleaner that processes files across entire project directories.
  • Style Compliance Reporting - Produces reports identifying differences between the current code and the PEP 8 style guide.
  • Aggressive Refactoring Modes - Includes an aggressive refactoring mode for resolving complex style violations and shortening long lines.
  • Recursive Directory Traversers - Walks through folder hierarchies to locate and process all Python source files within a project path.
  • Code Formatters - Automatically adjusts code to conform to PEP 8 standards.

Star 历史

hhatto/autopep8 的 Star 历史图表hhatto/autopep8 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

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

Start searching with AI

Autopep8 的开源替代方案

相似的开源项目,按与 Autopep8 的功能重合度排序。
  • realpython/materialsrealpython 的头像

    realpython/materials

    5,173在 GitHub 上查看↗

    This project is a comprehensive collection of Python programming education materials, including tutorials, exercises, and curated code samples. It serves as a learning curriculum and software engineering toolkit, utilizing Jupyter Notebooks to combine executable code with descriptive educational text. The repository provides practical implementation guides for building large language model applications, such as retrieval-augmented generation systems, stateful AI agents, and machine learning workflows. It distinguishes itself by offering a structured approach to agentic coding workflows, cover

    Jupyter Notebook
    在 GitHub 上查看↗5,173
  • 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
  • ansible/ansible-lintansible 的头像

    ansible/ansible-lint

    3,876在 GitHub 上查看↗

    ansible-lint is a static code analysis tool and linter designed to identify syntax errors and best practice violations within Ansible playbooks and roles. It functions as a quality gate for automation pipelines, scanning configuration files and scripts without executing the code to ensure reliability and consistency. The project distinguishes itself by acting as an automated code formatter that can correct identified linting issues and reformat files to meet community standards. It also serves as a dependency manager, automatically detecting and installing required roles and collections from

    Pythonansibleansible-dev-toolsansible-lint
    在 GitHub 上查看↗3,876
  • squizlabs/php_codesniffersquizlabs 的头像

    squizlabs/PHP_CodeSniffer

    10,771在 GitHub 上查看↗

    PHP_CodeSniffer is a static analysis tool, coding standard linter, and command-line validator for PHP. It scans files and directories to detect and report formatting errors and language-specific coding violations without executing the code. The project functions as an automated code formatter capable of correcting detected style and formatting violations to bring source code into compliance with defined standards. It uses token-based lexical analysis to match code patterns against rule sets, ensuring consistency across a codebase. The tool provides comprehensive capabilities for recursive fi

    PHPautomationclicoding-standards
    在 GitHub 上查看↗10,771
查看 Autopep8 的所有 30 个替代方案→

常见问题解答

hhatto/autopep8 是做什么的?

autopep8 是一个 Python 静态代码样式器和格式化程序,旨在自动重写源代码以符合 PEP 8 样式指南。它作为一个递归代码清理器,识别并修复整个项目中的缩进、空格和语法不规范之处。

hhatto/autopep8 的主要功能有哪些?

hhatto/autopep8 的主要功能包括:Python Code Formatters, Python Source Formatters, Python Style Checkers, Automated Lint Fixes, AST-Based Refactoring, Source Code Formatting, PEP 8 Rule Detection, Python Static Analyzers。

hhatto/autopep8 有哪些开源替代品?

hhatto/autopep8 的开源替代品包括: realpython/materials — This project is a comprehensive collection of Python programming education materials, including tutorials, exercises,… google/yapf — YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete… ansible/ansible-lint — ansible-lint is a static code analysis tool and linter designed to identify syntax errors and best practice violations… squizlabs/php_codesniffer — PHP_CodeSniffer is a static analysis tool, coding standard linter, and command-line validator for PHP. It scans files… google/gts — gts provides standardized utilities for project bootstrapping and the application of consistent linting and formatting… ambv/black — Black is a deterministic Python code formatter and style guide enforcer. It automatically reformats source code and…