From cb98e2fa7566e0e269e7447858e0151483e9197f Mon Sep 17 00:00:00 2001 From: dev-runner Date: Mon, 19 Oct 2026 15:05:07 +0500 Subject: [PATCH] =?UTF-8?q?[writer]=20=D0=BF=D0=BB=D0=B0=D0=BD=20helloworl?= =?UTF-8?q?d=20(=D0=BA=D0=BE=D0=BD=D0=B2=D0=B5=D0=B9=D0=B5=D1=80=20DevHub)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- llm-artifacts/02-writer.md | 90 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 llm-artifacts/02-writer.md diff --git a/llm-artifacts/02-writer.md b/llm-artifacts/02-writer.md new file mode 100644 index 0000000..559c373 --- /dev/null +++ b/llm-artifacts/02-writer.md @@ -0,0 +1,90 @@ +# План приложения helloworld + +## Структура проекта + +``` +helloworld/ +├── src/ +│ └── main.py +├── tests/ +│ └── test_main.py +├── .gitignore +├── README.md +└── requirements.txt +``` + +## Файлы + +1. **src/main.py** + ```python + def say_hello(): + return "Hello, World!" + + if __name__ == "__main__": + print(say_hello()) + ``` + +2. **tests/test_main.py** + ```python + import unittest + from src.main import say_hello + + class TestMain(unittest.TestCase): + def test_say_hello(self): + self.assertEqual(say_hello(), "Hello, World!") + + if __name__ == "__main__": + unittest.main() + ``` + +3. **.gitignore** + ``` + /tests/__pycache__/ + ``` + +4. **README.md** + ```markdown + # helloworld + Простое приложение на Python, выводящее "Hello, World!". + ``` + +5. **requirements.txt** + ``` + # No external dependencies required + ``` + +## Шаги сборки + +1. Создайте новый каталог для проекта `helloworld`. +2. Создайте файл `src/main.py` и вставьте в него код: + ```python + def say_hello(): + return "Hello, World!" + + if __name__ == "__main__": + print(say_hello()) + ``` +3. Создайте каталог `tests` и файл `tests/test_main.py` с кодом: + ```python + import unittest + from src.main import say_hello + + class TestMain(unittest.TestCase): + def test_say_hello(self): + self.assertEqual(say_hello(), "Hello, World!") + + if __name__ == "__main__": + unittest.main() + ``` +4. Создайте файл `.gitignore` с содержимым: + ``` + /tests/__pycache__/ + ``` +5. Создайте файл `README.md` с содержимым: + ```markdown + # helloworld + Простое приложение на Python, выводящее "Hello, World!". + ``` +6. Создайте файл `requirements.txt` и оставьте его пустым, так как нет внешних зависимостей. +7. В терминале перейдите в каталог `helloworld` и выполните команду `python -m unittest tests/test_main.py` для запуска тестов. +8. Если тесты прошли успешно, приложение готово к использованию.