Перейти к содержимому
Топаздокументация
6.05.21

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

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

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

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

    Загрузка

    Инструменты

    migrate

    Preview or apply source edits from Topaz 5.21 to Topaz 6.0.

    Режим языка
    6.0
    Продукт
    Не выпущен

    Invocation, options and results

    topaz migrate

    Форма вызова
    1. topaz migrate [entry] [options]

    Доступность

    Включено по умолчанию · Да

    This command is available in the 6.0 runner.

    This command is available in the 6.0 runner.

    Ввод

    entry is optional.

    Параметры и конфликты

    ПараметрЗначение по умолчаниюКонтрактКонфликты
    --root <dir>Не указано

    module-system root; the entry must be under it. With no entry it selects the package directory

    Не перечислены
    --from 5.21Не указано

    Select a local registry directory for vendor or the source edition for migrate.

    Не перечислены
    --to 6.0Не указано

    Select the destination language edition.

    Не перечислены
    --applyНе указано

    Apply a completely checked migration.

    Не перечислены

    Каналы вывода

    stdout

    stderr

    Статус завершения

    Эффекты

    The default preview writes no files. --apply publishes the prepared changes together only when there is no manual work, the destination passes a complete 6.0 check, and the original inputs are unchanged. A check that cannot finish exits 3 without applying changes.

    This command is available in the 6.0 runner.

    Operation

    Use --from 5.21 --to 6.0. With an entry, migrate its source graph. Without an entry, use the package selected by --root or the current directory. The command proposes deterministic syntax edits and identifies manual work by file and byte range.

    Example contract

    Правилоtools-commands-migrate.rule.invocation

    Example contract

    The invocation topaz migrate main.tpz --from 5.21 --to 6.0 is expected to exit with 0.

    The preview identifies the original byte range of the control input. It leaves the file unchanged.

    Example

    Preview 5.21 migration edits

    main.tpzPreview 5.21 migration edits
    1. if true { () }
    Ожидаемый выводКод завершения 0
    main.tpz
      [3, 7)
    Migration would change 1 file(s).
    
    $ topaz migrate main.tpz --from 5.21 --to 6.0
    Ожидаемый результат

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

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

    Ожидаемый стандартный вывод
    1. main.tpz
    2. [3, 7)
    3. Migration would change 1 file(s).

    The preview identifies the original byte range of the control input. It leaves the file unchanged.