1 个仓库
Tools that use abstract syntax tree manipulation to perform structural code changes beyond simple whitespace formatting.
Distinct from Python Code Formatters: Focuses on structural AST transformations (like identity tests) rather than general style formatting.
Explore 1 awesome GitHub repository matching programming languages & runtimes · AST-Based Refactoring. Refine with filters or upvote what's useful.
autopep8 是一个 Python 静态代码样式器和格式化程序,旨在自动重写源代码以符合 PEP 8 样式指南。它作为一个递归代码清理器,识别并修复整个项目中的缩进、空格和语法不规范之处。 该工具使用抽象语法树(AST)转换执行结构化重构,以执行非空格更改,例如缩短长行和改进身份测试。它包括用于复杂样式违规的激进重构模式,并支持通过内联标记进行选择性格式化,以禁用特定代码块的更改。 功能包括用于定位或忽略特定错误代码的基于规则的修复过滤、行范围格式化,以及生成样式差异报告。该系统可以通过具有递归目录遍历和原地文件修改的命令行界面处理文件,也可以通过 API 以编程方式集成。 格式化偏好和规则集可以通过全局或本地配置文件进行管理。
Performs structural refactoring using abstract syntax tree transformations to execute non-whitespace changes.