贡献指南
前置条件
- Python 3.10+
- uv
搭建环境
git clone https://github.com/aliyun/iac-code.git
cd iac-code
make install
make install 会安装所有依赖并配置 pre-commit 钩子(每次提交自动执行 lint 和 format 检查)。
开发流程
以调试模式运行:
make dev
运行测试:
make test # 默认 Python 版本
make test PY=3.12 # 指定版本
make test PY=all # 所有支持的版本(3.10–3.14)
代码质量:
make lint # ruff check + ty check
make format # ruff format
覆盖率:
make coverage
项目结构
src/iac_code/ # 源代码
tests/ # 测试
website/ # 文档站点(Docusaurus)
提交变更
- Fork 仓库并创建功能分支。
- 编写代码并补充测试。
- 运行
make format,然后确保make lint和make test通过。 - 向
main分支提交 Pull Request。