Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
python-version: ["3.9"]

steps:
Expand Down
46 changes: 46 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# LeanUp Agent Notes

## 项目信息

- 主语言:Python
- CLI 入口:`leanup`
- 代码路径:`leanup/`
- 文档:`README.md`、`docs/`

## 目录边界

```text
leanup/
├── cli/ # CLI 入口与编排
├── repo/ # Lean / elan / repo 相关核心逻辑
├── utils/ # 通用工具与配置能力
└── const.py # 常量定义
```

## 开发规范

### CLI

- 命令优先,交互兜底。
- 缺必要参数时自动进入 interactive;`-i` 强制交互,`-I` 禁止交互。
- interactive 展示的默认值必须和最终实际执行一致。
- 新交互统一收敛到共享 interaction 层,不在命令文件里重复写 `click.prompt` / `click.confirm` 流程。
- CLI 文件只做接入、参数编排和输出组织,不承载主要业务实现。

### 代码结构

- `cli/` 负责入口编排。
- `repo/` 负责 Lean / elan / 仓库相关核心逻辑。
- `utils/` 只放真正通用的工具能力,不把业务逻辑塞进去。
- 相同行为优先复用,不重复实现。

### 文档

- 当前以中文主文档为准,不继续维护英文平行文档。
- 功能变更同步更新 `README.md` 和 `docs/`。

### 测试

- 先保证最小可运行测试覆盖。
- 与 CLI 行为强相关的改动,测试要同步更新。
- 新测试优先保持意图清晰、边界明确,不继续扩散历史风格。
104 changes: 50 additions & 54 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,118 @@
# 贡献指南 / Contributing Guide
# 贡献指南

感谢您对 LeanUp 项目的关注!我们欢迎各种形式的贡献
感谢您对 LeanUp 项目的关注!欢迎各种形式的贡献

Thank you for your interest in contributing to LeanUp! We welcome all kinds of contributions.
## 🚀 快速开始

## 🚀 快速开始 / Quick Start
### 环境准备

### 环境准备 / Environment Setup

1. Fork 并克隆仓库 / Fork and clone the repository:
1. Fork 并克隆仓库:
```bash
git clone https://github.com/yourusername/LeanUp.git
cd LeanUp
```

2. 创建虚拟环境 / Create virtual environment:
2. 创建虚拟环境
```bash
python -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windows
```

3. 安装依赖 / Install dependencies:
3. 安装依赖
```bash
pip install -e .
pip install -r requirements_dev.txt
```

## 🧪 测试 / Testing
## 🧪 测试

运行测试确保一切正常 / Run tests to ensure everything works:
运行测试确保一切正常

```bash
# 运行所有测试 / Run all tests
# 运行所有测试
pytest tests/ -v

# 运行测试并生成覆盖率报告 / Run tests with coverage
# 运行测试并生成覆盖率报告
coverage run -m pytest tests/
coverage report -m

# 代码风格检查 / Code style check
# 代码风格检查
ruff check .

# 类型检查 / Type checking
# 类型检查
mypy .
```

## 📝 代码规范 / Code Standards
## 📝 代码规范

- 使用 Python 3.9+ / Use Python 3.9+
- 遵循 PEP 8 代码风格 / Follow PEP 8 style guide
- 添加适当的类型注解 / Add appropriate type hints
- 为新功能编写测试 / Write tests for new features
- 保持代码覆盖率 > 85% / Maintain code coverage > 85%
- 使用 Python 3.9+
- 遵循 PEP 8 代码风格
- 添加适当的类型注解
- 为新功能编写测试
- 保持代码覆盖率 > 85%
- 具体开发约束以 `AGENTS.md` 和 `DEVELOP.md` 为准

## 🔄 提交流程 / Submission Process
## 🔄 提交流程

1. 创建功能分支 / Create feature branch:
1. 创建功能分支
```bash
git checkout -b feature/your-feature-name
```

2. 进行更改并提交 / Make changes and commit:
2. 进行更改并提交
```bash
git add .
git commit -m "描述你的更改 / Describe your changes"
```

3. 推送到你的 fork / Push to your fork:
3. 推送到你的 fork
```bash
git push origin feature/your-feature-name
```

4. 创建 Pull Request / Create Pull Request
4. 创建 Pull Request

## 📋 提交信息格式 / Commit Message Format
## 📋 提交信息格式

```
类型(scope): 简短描述

详细描述(可选)

类型 / Type:
- feat: 新功能 / new feature
- fix: 修复 bug / bug fix
- docs: 文档更新 / documentation update
- style: 代码格式化 / code formatting
- refactor: 代码重构 / code refactoring
- test: 测试相关 / test related
- chore: 构建/工具相关 / build/tooling related
类型
- feat: 新功能
- fix: 修复 bug
- docs: 文档更新
- style: 代码格式化
- refactor: 代码重构
- test: 测试相关
- chore: 构建/工具相关
```

## 🐛 报告问题 / Reporting Issues
## 🐛 报告问题

报告 bug 或提出功能请求时,请提供:
When reporting bugs or requesting features, please provide:

- 操作系统和版本 / Operating system and version
- Python 版本 / Python version
- LeanUp 版本 / LeanUp version
- 重现步骤 / Steps to reproduce
- 期望行为 / Expected behavior
- 实际行为 / Actual behavior
- 操作系统和版本
- Python 版本
- LeanUp 版本
- 重现步骤
- 期望行为
- 实际行为

## 💡 功能请求 / Feature Requests
## 💡 功能请求

我们欢迎新功能的建议!请确保:
We welcome suggestions for new features! Please ensure:
欢迎新功能建议,请尽量确保:

- 功能与项目目标一致 / Feature aligns with project goals
- 提供清晰的用例 / Provide clear use cases
- 考虑向后兼容性 / Consider backward compatibility
- 功能与项目目标一致
- 提供清晰的用例
- 考虑向后兼容性

## 📞 联系我们 / Contact Us
## 📞 联系方式

- 通过 GitHub Issues 讨论 / Discuss via GitHub Issues
- 邮箱 / Email: leanprover@outlook.com
- 通过 GitHub Issues 讨论
- 邮箱leanprover@outlook.com

感谢您的贡献!🎉
Thank you for your contributions! 🎉
感谢您的贡献!
34 changes: 34 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# LeanUp 开发简版指南

## 目标

LeanUp 当前对齐 ChatTool 的开发方向:

- CLI 风格统一
- 入口和逻辑分层
- 文档以中文主版本为准
- 测试随行为变化同步更新

## CLI 规范

- 默认遵循:命令优先,交互兜底。
- 缺必要参数时进入 interactive。
- `-i` 强制 interactive。
- `-I` 禁止 interactive,参数不足时直接报错。
- prompt 默认值必须与最终执行值一致。

## 代码规范

- `leanup/cli/` 只保留命令入口和编排。
- 具体逻辑下沉到 `repo/` 或 `utils/`。
- 避免 CLI 文件不断膨胀成“命令 + 业务 + 交互 + 配置解析”四合一。

## 文档规范

- 主文档使用中文。
- 清理重复文档和英文平行版本。

## 测试规范

- 改行为就改测试。
- 优先修正现有测试到当前设计,不为旧接口加兼容层。
Loading
Loading