| applyTo | **/*.py |
|---|
These rules apply automatically whenever Copilot works on a Python file in this project. They never load for other file types, so a conversation about a Dockerfile or some JSON stays clutter-free.
- Follow PEP 8 style conventions.
- Add type hints to every function signature.
- Prefer f-strings over
%formatting orstr.format().
- Catch specific exceptions; never use a bare
except:. - Validate inputs at function boundaries and fail with a clear message.
- Put pytest tests in
samples/book-app-project/tests/usingtest_*.pynaming. - Cover the happy path and edge cases (empty input, missing data).