본문으로 건너뛰기
토파즈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.

    메뉴

    다운로드 →