Skip to content

docs(contributing): clarify fork and lint workflow - #302

Open
ooooo-create wants to merge 1 commit into
redai-studio:mainfrom
ooooo-create:docs/contributing-workflow
Open

docs(contributing): clarify fork and lint workflow#302
ooooo-create wants to merge 1 commit into
redai-studio:mainfrom
ooooo-create:docs/contributing-workflow

Conversation

@ooooo-create

Copy link
Copy Markdown
Contributor

What

Complete the fork-to-PR workflow in CONTRIBUTING.md and the English and Chinese contribution guides. Add pre-commit installation instructions and replace the guides' outdated Black, isort, and Flake8 commands with pre-commit run --all-files.

Why

The guides clone the upstream repository directly, leaving external contributors without a writable push destination. The formatting instructions also differ from the repository's current pre-commit configuration.

How

Explain how to fork and clone the repository, push a named branch to the fork, and open a PR against redai-studio/Relax:main. Keep the English and Chinese instructions aligned.

Testing

  • pre-commit run --all-files passes (run with --show-diff-on-failure; a temporary python alias pointed to the installed python3).
  • Tests pass (pytest tests/) — not run: documentation-only changes; integration tests require multi-node GPU hardware.
  • New tests added (if applicable) — not applicable.
  • Documentation updated (if applicable).

Also verified git diff --check and matching command examples in the English and Chinese guides.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

Not applicable.

# 📝 Documentation

- Explain how to fork Relax, clone the fork, and open a PR against upstream main in CONTRIBUTING.md and both contribution guides.
- Add the pre-commit installation command to development setup.
- Replace the Black, isort, and Flake8 commands in the English and Chinese guides with pre-commit checks.

## Validation

- Pass pre-commit run --all-files --show-diff-on-failure using a temporary python alias to the installed python3.
- Skip multi-node GPU integration tests because this change only updates documentation.
Copilot AI lite review requested due to automatic review settings September 7, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The docs should complete the pre-commit setup (pre-commit install) and avoid hardcoded branch names in git push examples to prevent copy/paste failures.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the contribution documentation to reflect the repo’s current workflow: contributors should fork before cloning, and use the repo’s pre-commit configuration (instead of the previously documented Black/isort/Flake8 commands).

Changes:

  • Document the fork → clone → branch → push-to-fork → PR flow across CONTRIBUTING.md and both language guides.
  • Add pre-commit installation instructions and standardize on pre-commit run --all-files for lint/format checks.
  • Keep English and Chinese guides aligned on the updated steps.
File summaries
File Description
docs/zh/guide/how-to-contribute.md Updates Chinese contributing guide with fork-based workflow and pre-commit-based lint/format instructions.
docs/en/guide/how-to-contribute.md Updates English contributing guide with fork-based workflow and pre-commit-based lint/format instructions.
CONTRIBUTING.md Clarifies top-level contributing steps for external contributors (fork workflow + pre-commit).
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 6
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CONTRIBUTING.md
Comment on lines +60 to +61
# Install pre-commit
pip install pre-commit
Comment thread CONTRIBUTING.md
Push your branch to your fork:

```bash
git push origin feature/your-feature-name
Comment on lines +26 to +27
# Install pre-commit
pip install pre-commit
Comment on lines 115 to 116
# Push to your fork
git push origin feature/your-feature-name
Comment on lines +26 to +27
# 安装 pre-commit
pip install pre-commit
Comment on lines 115 to 116
# 推送到您的 fork
git push origin feature/your-feature-name
### 1. 设置开发环境

创建虚拟环境并安装依赖
先将 [redai-studio/Relax](https://github.com/redai-studio/Relax) **Fork** 到自己的账号,再执行以下命令(将 `<your_user_name>` 替换为您的 GitHub 用户名)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
先将 [redai-studio/Relax](https://github.com/redai-studio/Relax) **Fork** 到自己的账号,再执行以下命令(将 `<your_user_name>` 替换为您的 GitHub 用户名):
先将 [redai-studio/Relax](https://github.com/redai-studio/Relax) **Fork** 到自己的账号,再执行以下命令(将 `<your_user_name>` 替换为你的 GitHub 用户名):

社区一般不需要使用「您」

pip install -e .

# 安装 pre-commit
pip install pre-commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pre-commit 安装是不是放在 format and lint 那块比较合适?

@SigureMo

SigureMo commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

@rai-studio-bot 来 review 下

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

已按请求完成审查,未发现需要阻塞合入的问题。新增文件可能漏过本地检查的流程问题已在行内评论中说明,并附可直接应用的建议。CI 检查均已通过,PR 标题、说明及测试范围与此次文档改动一致。

Powered by Nyanpasu with gpt-6-astra medium, please check the suggestions carefully.

# 运行 linter
flake8 relax/
# 运行 pre-commit 检查(lint + 格式化)
pre-commit run --all-files

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 优先级:P2

请在检查前将新增文件加入 Git 跟踪。这里替换掉的目录扫描命令会检查新建的 Python 文件,而 pre-commit run --all-files 通过 git ls-files 选择文件,不会包含未跟踪文件。指南直到下一步才执行 git add .,因此按顺序新增模块或测试时,本地 lint/格式化会漏检这些文件,提交后 CI 才会发现问题。

可在此提前暂存,保留下一步的 git add . 以收录格式化产生的修改;英文指南同一位置也请同步调整。

Suggested change
pre-commit run --all-files
# 先暂存本次更改,让新增文件也参与检查
git add .
pre-commit run --all-files

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.

4 participants