Skip to content

Failing ty swallows previous stdout #20

Description

@iamkhav

Description

Using the ty hook currently results in ty removing previous stdout if there is any type error (i.e. the hook is failing and displaying output).

Previously we had solved this by using the --no-progress option and doing something like

  - repo: local
    hooks:
      - id: typecheck
        name: ty typecheck
        types_or: [ python, toml ]
        language: python
        pass_filenames: false
        additional_dependencies: [ "ty==0.0.63" ]
        entry: uv run --frozen ty check --no-progress

but we really like the option of using ty-pre-commit because it means we can bump ty with pre-commit's autoupdate on our CI.

It looks to me like any additional args given are not effective.

  - repo: https://github.com/astral-sh/ty-pre-commit
    rev: v0.0.63
    hooks:
      - id: ty
        args: [--no-progress]

^ doesn't solve the issue

For example, this still results in colorful output:

  - repo: https://github.com/astral-sh/ty-pre-commit
    rev: v0.0.63
    hooks:
      - id: ty
        args: [--color, never, --no-progress]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions