From 354a81d5d1e31691a84bcb8736e170abbe49d093 Mon Sep 17 00:00:00 2001 From: Kirill Mokevnin Date: Wed, 12 Aug 2026 19:52:07 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=D0=B3=D0=BE=D0=BD=D1=8F=D1=82=D1=8C?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=D1=8B=20=D0=B8=D0=B7=20?= =?UTF-8?q?README,=20=D0=B0=20=D0=BD=D0=B5=20=D0=BE=D0=B1=D0=B5=D1=89?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D1=8D=D1=82=D0=BE=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В README стояло «This code will be doctested. Do not touch the markup!», но доктеста не было ни в Makefile, ни в CI, а сама разметка была не доктестовой: отступ вместо >>> и ожидаемые значения в комментариях. То есть примеры никто не проверял, и разойтись с кодом они могли молча. Блок переписан в настоящий doctest, добавлена цель doctest и шаг в CI. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/pyci.yml | 2 ++ Makefile | 7 +++++-- README.md | 21 +++++++++++++-------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pyci.yml b/.github/workflows/pyci.yml index 7956d81..827bed5 100644 --- a/.github/workflows/pyci.yml +++ b/.github/workflows/pyci.yml @@ -25,3 +25,5 @@ jobs: run: make lint - name: Run tests run: make test + - name: Run doctests + run: make doctest diff --git a/Makefile b/Makefile index 29f7119..527e7a7 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,10 @@ lint: test: @uv run pytest test -check: install lint test +doctest: + @uv run pytest --doctest-glob='*.md' README.md + +check: install lint test doctest build: @uv build @@ -17,4 +20,4 @@ build: publish: build @uv publish --trusted-publishing always -.PHONY: install lint test check build publish +.PHONY: install lint test doctest check build publish diff --git a/README.md b/README.md index c50d403..8415373 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,19 @@ pip install hexlet-points ## Usage example - - - from hexlet import points - p = points.make(100, 200) - print(points.to_string(p)) # (100, 200) - points.get_x(p) # 100 - points.get_y(p) # 200 - points.get_quadrant(p) # 1 +```python +>>> from hexlet import points +>>> p = points.make(100, 200) +>>> print(points.to_string(p)) +(100, 200) +>>> points.get_x(p) +100 +>>> points.get_y(p) +200 +>>> points.get_quadrant(p) +1 + +``` ---