Skip to content

Commit f17d10c

Browse files
committed
Updated Copilot instructions.
1 parent 34454ce commit f17d10c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/copilot-instructions.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Key data flows: Bar events → Strategies → Trading signals → Position manag
1313
## Development Workflow
1414
- **Dependencies**: Use Poetry (`poetry install --all-extras`). Python 3.10+ required.
1515
- **Linting**: `invoke lint` runs mypy and ruff (line length 120, excludes `pocs/`)
16-
- **Testing**: `invoke test` runs pytest with 100% coverage requirement. Use `--html_report` for coverage HTML.
16+
- **Testing**: `invoke test` runs lint + pytest with 100% line coverage required.
17+
- **Single test**: `poetry run pytest tests/test_file.py::test_name -vv --no-cov`
1718
- **Cleaning**: `invoke clean` removes caches and build artifacts
1819
- **Documentation**: `invoke build_docs` generates Sphinx docs in `docs/_build/html/`
1920

@@ -43,13 +44,17 @@ Key data flows: Bar events → Strategies → Trading signals → Position manag
4344
- **Live Trading**: Requires API keys. Use `realtime_dispatcher()` instead of `backtesting_dispatcher()`.
4445
- **Precision Handling**: Use `round_decimal()`/`truncate_decimal()` for display/calculation precision.
4546

47+
## Testing Conventions
48+
- `asyncio_mode = auto` (setup.cfg) — async test functions run without `@pytest.mark.asyncio`.
49+
- Pytest fixtures `backtesting_dispatcher` and `realtime_dispatcher` are available globally via `tests/conftest.py`.
50+
- Shared test pairs/pair-infos live in `tests/common.py` (e.g. `btc_pair`, `btc_pair_info`).
51+
- 100% line coverage is required; use `# pragma: no cover` only for unreachable/platform-specific branches.
52+
4653
## Common Pitfalls
4754
- Naive datetimes cause issues - always use timezone-aware (`dt.utc_now()`).
4855
- Concurrent position modifications require locks (`asyncio.Lock` per pair).
4956
- WebSocket reconnections handled automatically, but monitor for gaps.
5057
- Borrowing disabled by default in samples - set `borrowing_disabled=False` to enable shorts.</content>
5158

5259
## Permissions
53-
- Do not run git commit, git add, are create any branches. Let me stage and/or commit manually.
54-
- Always ask before installing new packages and never do it unless its inside a virtual environment.
55-
60+
- Always ask before installing new packages and do it inside a virtual environment.

0 commit comments

Comments
 (0)