kwork-api/CONTRIBUTING.md
root 0c22b31e1c
Some checks failed
Release & Publish / build (push) Failing after 2m31s
Release & Publish / publish-gitea (push) Has been skipped
Release & Publish / docs (push) Has been skipped
ci: setup complete CI/CD with PR checks, release pipeline, and conventions
- Add PR checks workflow (tests, lint, security, commitlint)
- Add release workflow (build, publish to Gitea, deploy docs)
- Add pre-commit hooks (ruff, format, commitlint)
- Add CONTRIBUTING.md with development guidelines
- Add commitlint configuration
- Rename master → main branch
- Configure ruff, pytest, coverage in pyproject.toml
2026-03-28 23:38:19 +00:00

106 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Contributing to kwork-api
## Development Setup
```bash
# Clone repository
git clone https://git.much-data.ru/much-data/kwork-api.git
cd kwork-api
# Install UV (if not installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync --group dev
# Install pre-commit hooks
uv run pre-commit install
```
## Branch Naming
- `feature/description` — новые фичи
- `fix/description` — багфиксы
- `docs/description` — документация
- `refactor/description` — рефакторинг
## Commit Messages
Используем [Conventional Commits](https://www.conventionalcommits.org/):
```
<type>(<scope>): <description>
[optional body]
[optional footer]
```
**Types:**
- `feat` — новая фича
- `fix` — исправление бага
- `docs` — документация
- `style` — форматирование
- `refactor` — рефакторинг
- `test` — тесты
- `chore` — обслуживание
- `ci` — CI/CD
**Примеры:**
```
feat(validation): add /api/validation/checktext endpoint
fix(auth): handle expired token error
docs(api): update client examples
```
## Pre-commit Hooks
Автоматически запускаются перед коммитом:
1. **ruff check** — линтинг с авто-исправлением
2. **ruff format** — форматирование кода
3. **commitlint** — проверка формата коммита
Перед push:
- **pytest** — запуск тестов
## Pull Requests
1. Создай ветку от `main`
2. Вноси изменения с правильными коммитами
3. Запушь ветку
4. Создай PR в `main`
5. Дождись прохождения CI
6. После review — merge
## CI/CD
**PR Checks:**
- ✅ Тесты с coverage
- ✅ Линтинг
- ✅ Форматирование
- ✅ Безопасность (secrets scan)
- ✅ Commitlint (PR title)
**Release (merge в main):**
- 📦 Сборка пакета
- 🚀 Публикация в Gitea Packages
- 📚 Деплой документации
**Tag (v*):**
- 🏷️ Создание релиза
- 📦 Публикация версии
## Versioning
Используем [Semantic Versioning](https://semver.org/):
- `MAJOR.MINOR.PATCH` (например, `1.2.3`)
- Теги: `v1.2.3`
Для создания релиза:
```bash
git tag v1.2.3
git push origin v1.2.3
```