Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика TPZ3005

    A module resolves through a physical path or symlink outside the module root.

    Diagnostic and cause

    Ссылка

    Physical path escapes root

    Семейство
    topaz
    Этап
    resolve
    Код
    TPZ3005

    Причина и условия

    An imported source whose canonical physical path lies outside the selected root is rejected with TPZ3005 before its source is loaded.

    Действия

    Place the source inside the root or choose a root that contains its physical location. Check symbolic-link targets as well as import spellings.

    Compiler phase: resolve.

    Compiler explanation: A module resolves through a physical path or symlink outside the module root.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • the entry ⟨value⟩ resolves outside the root (symlink/alias containment) Source
    • ⟨value⟩ resolves outside the root (symlink/alias containment) Source

    The imported path crosses a symbolic link to a physical source outside the selected root. Textual containment of the import path does not admit the target.

    Правилоdiagnostics.tpz3005.rule

    Trigger and repair

    An imported source whose canonical physical path lies outside the selected root is rejected with TPZ3005 before its source is loaded.

    Response

    Ссылка

    Place the source inside the root or choose a root that contains its physical location. Check symbolic-link targets as well as import spellings.

    Reproduction and verification

    Ссылка

    Product diagnostic test

    Ссылка
    root/example.tpzProduct diagnostic testОткрыть песочницу →
    1. import lib
    Целевой продукт 5.21.3
    outside/lib.tpzProduct diagnostic testОткрыть песочницу →
    1. export let value = 1
    Ожидаемый результат

    Ожидаемый результат

    The separate diagnostic product test validates this command, runtime diagnostic, or filesystem setup. The shared example runner does not execute that assertion plan.

    Prepare the files shown above, then complete this setup.

    Create the symbolic link root/lib.tpz with target ../outside/lib.tpz. Keep the link and its target within the same temporary test directory.

    Run topaz check root/example.tpz --language-version 5.21 --root root.

    Expect exit status 1, empty standard output, and TPZ3005.

    The imported path crosses a symbolic link to a physical source outside the selected root. Textual containment of the import path does not admit the target.

    The primary location is root/example.tpz:1:8.

    Expect exactly one diagnostic.

    The diagnostic product test checks these expectations with the same files and command.

    Corrected program

    Ссылка
    root/example.tpzCorrected programОткрыть песочницу →
    1. import lib
    Ожидаемый выводКод завершения 0
    $ topaz check root/example.tpz --root root · Целевой продукт 5.21.3
    root/lib.tpzCorrected programОткрыть песочницу →
    1. export let value = 1
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    This program applies the repair described above. The verification status records whether it has been run.

    Меню

    Загрузка →