Repository navigation
refactor: drop the package name check - #42
Merged
Merged
Conversation
The action refused a project whose manifest carried a name other than the one fixed for its language. The rule is enforced by the projects themselves wherever it means anything, so the check only added a second, earlier and less legible failure. Where the name is load-bearing: the php library projects, whose root composer.json requires `hexlet/code` from a path repository. Composer resolves a path package by name, so a wrong name fails `composer install` with a message that names the package. Where it is not: for javascript the harness declares the dependency as `"@hexlet/code": "file:code"`, and npm installs a path dependency under that key whatever the package calls itself — verified on a stand, a package named `wrong-name` installs and imports as `@hexlet/code`. For python nothing reads the distribution name at all: the console scripts of every project have names of their own. __tests__/packageChecker.test.js already carried the same conclusion in a comment: "in some languages, verification is not needed, since the package name is verified when installing the dependencies". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
Снимает
checkPackageName— проверку, которая отказывала проекту, если имя в манифесте студента отличалось от зафиксированного для его языка (hexlet-code/hexlet/code/@hexlet/code).Почему
Там, где имя что-то значит, его резолвит по имени сам харнесс проекта и падает раньше и понятнее. Там, где не значит, проверка требовала имя, которое не читает ничто.
php-библиотеки. Корневой
composer.jsonтребуетhexlet/codeиз path-репозитория. Composer резолвит path-пакет по имени, поэтому чужое имя роняетcomposer install. Так в 11 каталогах проектов.python-библиотеки. Корневой
pyproject.tomlобъявляетhexlet-code = { path = "code" }в[tool.uv.sources]. Проверено на стенде:uv syncотказывает сPackage metadata namewrong-namedoes not match given namehexlet-code``. Так в 15 каталогах.javascript — исключение. Харнесс объявляет зависимость как
"@hexlet/code": "file:code", и npm ставит path-зависимость по этому ключу независимо от того, как пакет назвал себя сам. Проверено и наnpm install, и наnpm ci: пакет с именемwrong-nameвстаёт вnode_modules/@hexlet/code, иimport … from "@hexlet/code"резолвится. Там имя — конвенция, и утверждать её должны тесты самого проекта; это делается отдельно, в репозиториях проектов.Тот же вывод уже лежал комментарием в удаляемом тесте:
Что в диффе
src/packageChecker.js,__tests__/packageChecker.test.js,__fixtures__/package_files/— удаленыcheck()снят, сигнатура сузилась до{ projectSourcePath }iniвыброшен из зависимостей — импортировался только чекеромAGENTS.md— раздел архитектуры описывает отсутствие проверки и её причину, ссылка в разделе команд переставлена с удалённого файла тестаПроверки
make lintиnpx jestзелёные локально.🤖 Generated with Claude Code