From 70e9f2dd2c1a429bba1277823d579d71e5da1976 Mon Sep 17 00:00:00 2001 From: greatmengqi Date: Sun, 29 Mar 2026 18:39:10 +0800 Subject: [PATCH] docs: add format step to contributing workflow (#1552) Co-authored-by: greatmengqi --- CONTRIBUTING.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index daab6c8af..5e4a6d934 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -250,15 +250,26 @@ Nginx (port 2026) ← Unified entry point 2. **Make your changes** with hot-reload enabled -3. **Test your changes** thoroughly +3. **Format and lint your code** (CI will reject unformatted code): + ```bash + # Backend + cd backend + make format # ruff check --fix + ruff format -4. **Commit your changes**: + # Frontend + cd frontend + pnpm format:write # Prettier + ``` + +4. **Test your changes** thoroughly + +5. **Commit your changes**: ```bash git add . git commit -m "feat: description of your changes" ``` -5. **Push and create a Pull Request**: +6. **Push and create a Pull Request**: ```bash git push origin feature/your-feature-name ``` @@ -284,8 +295,9 @@ Every pull request runs the backend regression workflow at [.github/workflows/ba ## Code Style -- **Backend (Python)**: We use `ruff` for linting and formatting -- **Frontend (TypeScript)**: We use ESLint and Prettier +- **Backend (Python)**: We use `ruff` for linting and formatting. Run `make format` before committing. +- **Frontend (TypeScript)**: We use ESLint and Prettier. Run `pnpm format:write` before committing. +- CI enforces formatting — PRs with unformatted code will fail the lint check. ## Documentation