11 个仓库
Tools that assist in modifying, cleaning, or modernizing existing codebases.
Explore 11 awesome GitHub repositories matching part of an awesome list · Code Refactoring. Refine with filters or upvote what's useful.
This project is a comprehensive collection of software design patterns implemented in Python. It serves as a reference for architectural, behavioral, creational, and structural patterns to guide the organization of Python applications. The collection covers behavioral strategies for managing object communication and state, creational techniques for controlling object instantiation, and structural methods for composing classes and objects into flexible hierarchies. It also includes architectural references for system-wide structuring, such as multi-tier architectures and blackboard models. Th
Identifies architectural anti-patterns and provides clean, idiomatic Python refactoring alternatives.
Awesome autocompletion, static analysis and refactoring library for python
Library for autocompletion and static analysis during refactoring.
MonkeyType 是一个用于 Python 的运行时类型推断和分析工具。它在程序执行期间从函数调用中收集实际的参数和返回类型,以自动生成静态类型注解和兼容的存根文件。 该系统将捕获的执行跟踪转换为静态类型提示,这些提示可以直接插入到源代码函数定义中,或用于生成外部类型存根。通过分析真实数据类型而非手动审计,该过程能够为现有代码库增加类型安全性。 该工具的功能涵盖运行时类型收集、动态类型推断以及静态类型定义的生成。它利用源代码修改和调用跟踪持久化,将观察到的运行时模式映射到静态签名。
Generates type annotations by observing runtime execution.
Vulture is a static analysis tool and linter designed to find unused variables, functions, and classes in Python source code. It operates as a dead code detector and unused code finder that scans source files to identify unreachable expressions and imports without executing the code. The tool employs a confidence-based heuristic scoring system to assign probability values to detections, helping to distinguish truly unused symbols from potential false positives. It further assists in pruning dead logic by sorting detected unused classes and functions by line count to prioritize the removal of
Identifies and removes unused or dead code.
pyupgrade 是一个 Python 静态代码现代化工具和语法升级器。它自动重写源代码,以根据指定的版本目标实现现代语言特性和语法。 该工具专注于通过删除已弃用的导入、兼容性垫片和过时的特定版本条件块来消除技术债务。它还重构类型注解以使用当前标准,例如简化的泛型别名和联合运算符。 其能力范围包括更新标准库使用、优化内置函数调用,以及将冗长的集合构造函数或字符串格式化转换为简洁的现代等价物。这些转换通过一个目标版本化的规则引擎执行,该引擎保留了原始格式和注释。
Automatically updates syntax to use modern language features.
a python refactoring library
Comprehensive library for automated code refactoring tasks.
Removes unused imports and unused variables as reported by pyflakes
Removes unused imports and variables from source files.
add-trailing-comma
Automatically inserts trailing commas for cleaner diffs.
com2ann
Converts type comments into modern type annotations.
.. image:: https://img.shields.io/pypi/v/massedit.svg :target: https://pypi.python.org/pypi/massedit/ :alt: PyPi version
Enables programmatic text editing across multiple files.
🚀 The ultimate linter and formatter for removing unused import statements in your code.
Cleans up unused import statements in Python files.