Some checks failed
CI / lint-and-test (push) Failing after 23s
- Added *.egg-info/ to .gitignore to prevent egg metadata from being tracked. - Updated virtual environment instructions in CONTRIBUTING.md and README.md to use .venv for consistency. - Revised mkdocs.yml to include a placeholder for the repository URL when publishing. - Cleaned up pyproject.toml by removing unnecessary pylint configuration. - Enhanced import-format.md and runbook.md documentation for clarity on user roles and health check endpoints.
69 lines
1.6 KiB
Markdown
69 lines
1.6 KiB
Markdown
# Contributing to Duty Teller
|
|
|
|
## Development setup
|
|
|
|
1. **Clone the repository**
|
|
```bash
|
|
git clone <repository-url>
|
|
cd duty-teller
|
|
```
|
|
|
|
2. **Create a virtual environment**
|
|
```bash
|
|
python -m venv .venv
|
|
source .venv/bin/activate # Linux/macOS
|
|
# or: .venv\Scripts\activate # Windows
|
|
```
|
|
|
|
3. **Install dependencies**
|
|
```bash
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
```
|
|
|
|
4. **Configure**
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
Set `BOT_TOKEN` and any other variables as needed (see README).
|
|
|
|
5. **Documentation (optional)**
|
|
To build and preview the docs (MkDocs + mkdocstrings):
|
|
```bash
|
|
pip install -e ".[docs]"
|
|
mkdocs build
|
|
mkdocs serve # preview at http://127.0.0.1:8000
|
|
```
|
|
|
|
## Running tests and linters
|
|
|
|
- **Tests** (from repository root; package is `duty_teller`, no `src/`):
|
|
```bash
|
|
pytest
|
|
```
|
|
Use `PYTHONPATH=.` if imports fail.
|
|
|
|
- **Lint** (ruff):
|
|
```bash
|
|
ruff check duty_teller tests
|
|
```
|
|
|
|
- **Security** (bandit):
|
|
```bash
|
|
bandit -r duty_teller -ll
|
|
```
|
|
|
|
## Commit messages
|
|
|
|
Use [Conventional Commits](https://www.conventionalcommits.org/), e.g.:
|
|
|
|
- `feat: add /pin_duty command`
|
|
- `fix: correct timezone in pinned message`
|
|
- `docs: update README env section`
|
|
|
|
Submit changes via pull requests (Gitea Flow); reviews consider functionality, code quality, and security.
|
|
|
|
## Releases
|
|
|
|
When cutting a release, update [CHANGELOG.md](CHANGELOG.md) with the new version and list changes under Added / Changed / Fixed / Security as appropriate (see [Keep a Changelog](https://keepachangelog.com/)).
|