# ToolBox **Repository Path**: agrui/tool-box ## Basic Information - **Project Name**: ToolBox - **Description**: 个人提高效率开发工具 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-10 - **Last Updated**: 2025-09-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README FixStyle ======== 功能特性 -------- - 自动修复最近一次 Git 提交中修改的代码格式问题 - 支持指定 tab 缩进大小 - 可清理二进制构建产物 - 支持多种文本文件格式处理 - 提供清晰的处理结果摘要 安装 ---- ### 从源码安装 1. 克隆或下载源码到本地 2. 进入项目目录后运行: ```bash pip install . ``` 或使用开发模式安装: ```bash pip install -e . ``` 3. 创建离线安装包: ```bash python setup.py bdist_wheel python setup.py sdist ``` 安装包将在 `dist/` 目录下生成 ### 离线安装 - 使用 wheel 包安装: ```bash pip install dist/fixstyle-*.whl ``` - 或使用源码包安装: ```bash pip install dist/fixstyle-*.tar.gz ``` 使用方法 -------- ### 基本使用 确保在 Git 仓库中运行,修复最近一次 commit 中修改文件的格式问题: ```bash fixstyle ``` ### 高级选项 - 指定 tab 大小(默认为 4 个空格): ```bash fixstyle --tab-size 2 ``` - 删除最近一次 commit 中的所有二进制构建产物: ```bash fixstyle --clean-binaries ``` - 查看版本信息: ```bash fixstyle --version ``` - 查看帮助信息: ```bash fixstyle --help ``` 支持的功能 ------------ - **代码格式修复**:自动修复缩进、空格等格式问题 - **二进制清理**:识别并删除常见的编译/构建产物 - **文件类型支持**:识别多种源代码和文本文件格式 工作原理 -------- 1. 通过 Git 获取最近一次提交修改的文件列表 2. 对每个文件进行格式检查和修复 3. 提供修复结果摘要 4. 可选清理二进制构建产物 示例流程 -------- ```bash # 提交代码 git add . git commit -m "Initial commit" # 运行 fixstyle 修复格式问题 fixstyle # 输出示例: Found 3 modified files in the latest commit. Processing: src/main.py ✓ Fixed formatting issues Processing: src/utils.py - No changes needed or file skipped Processing: README.md ✓ Fixed formatting issues Summary: Fixed formatting in 2 out of 3 files. Note: Files have been modified. You may want to commit these changes. # 提交修复后的文件 git add . git commit -m "Fix code formatting" ``` 系统要求 -------- - Python 3.6+ - Git 许可证 ------ 本项目遵循 MIT 许可证 - 查看 LICENSE 文件获取更多详情 贡献 ---- 欢迎贡献代码和改进!请提交 PR 或 issue 来参与项目改进