Skip to content

chore: modernizing project structure & CI#155

Open
mangodxd wants to merge 1 commit intoythx-101:mainfrom
mangodxd:cleanup/secure-1158255846
Open

chore: modernizing project structure & CI#155
mangodxd wants to merge 1 commit intoythx-101:mainfrom
mangodxd:cleanup/secure-1158255846

Conversation

@mangodxd
Copy link
Copy Markdown

@mangodxd mangodxd commented Apr 7, 2026

Modernizing project structure & ci 🚀

Hi! I'm a big fan of automation, so I put together a small suite of tools to help catch bugs and keep the code clean.

What's inside?

  • Standardized Metadata: Switched to pyproject.toml (the modern PEP 621 way) to keep configs in one place.
  • Contributor Docs: Added a basic guide to help new folks get started.
  • EditorConfig: Ensuring consistent coding styles across different IDEs.

Why?
Modern tooling like ruff and pyproject.toml makes the project much easier to maintain and more welcoming for new contributors. Plus, having a CI/CD safety net is always a win.

These are purely infrastructure-focused and won't touch any of your actual logic. Let me know what you think!


Pulled with ❤️ by me (ofc).

Copy link
Copy Markdown
Owner

@ythx-101 ythx-101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE

此 PR 为项目添加了基础配置文件,整体质量良好。以下是具体分析:

新增文件概述:

  • .editorconfig:统一编辑器格式配置,设置空格缩进(4格)和 UTF-8 编码,合理。
  • CONTRIBUTING.md:贡献指南,提示安装 pre-commit
  • SECURITY.md:安全政策,指示通过邮件报告漏洞。
  • pyproject.toml:项目构建与工具配置。

潜在问题(不阻塞合并):

  1. 项目名称可疑pyproject.tomlname = "tmpt7gekwh_" 看起来像是自动生成的临时名称,建议改为实际项目名称。

  2. ruff 配置位置错误select 字段应放在 [tool.ruff.lint] 下(Ruff v0.1.0+ 的规范),直接写在 [tool.ruff] 下已被废弃:

    [tool.ruff.lint]
    select = ["E", "F", "I", "UP", "B", "SIM", "PTH"]
  3. 文件末尾缺少换行CONTRIBUTING.mdSECURITY.md 缺少末尾换行(\ No newline at end of file),与 .editorconfig 的规范不一致,建议修复。

  4. SECURITY.md 信息不完整:仅说"通过邮件报告",但未提供具体邮件地址,对贡献者实用性较低。

  5. blackruff 格式化重复:同时配置两者可能引起冲突,建议明确只用其中一个作为格式化工具。

整体而言,这是一个良好的项目初始化 PR,上述问题均属于小瑕疵,不影响功能。

@Kline69
Copy link
Copy Markdown

Kline69 commented Apr 18, 2026

这个方向很实用!补充几点建议:

建议

  1. pyproject.toml:举双手赞成。统一 Python 项目元数据是趋势,建议同时保留 setup.py 兼容性(用 setuptools 的动态发现)

  2. CI 建议

    • 做 lint + format(比 black + flake8 快很多)
    • 做类型检查
    • GitHub Actions 用 缓存依赖
  3. Contributor Docs 建议加:

    • 本地开发环境快速启动(openclaw dev / docker-compose)
    • 代码风格指南
    • PR 流程说明

有兴趣可以参考 OpenClaw 主仓库的 CI 配置:https://github.com/openclaw/...(具体路径忘了,应该在 .github/workflows 下)

整体支持 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants