Skip to content

Conversation

@MichaReiser
Copy link
Member

Summary

Copy pasting ty's output from the CLI into GitHub resulted in a missing newline after Checked 9/9 files and the first diagnostic
when they are rendered. This is a known issue in indicatif (console-rs/indicatif#695).

The easiest fix is to clear the progress bar on completion, which I prefer anyways because it reduces the output produced by ty.

Fixes astral-sh/ty#1424

Test Plan

cargo run --manifest-path ../ruff/Cargo.toml --bin ty -- check 444/
   Compiling ty v0.0.0 (/Users/micha/astral/ruff/crates/ty)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.54s
     Running `/Users/micha/astral/ruff/target/debug/ty check 444/`
error[unresolved-import]: Cannot resolve imported module `binary`
 --> 444/lib.py:1:6
  |
1 | from binary import *
  |      ^^^^^^
2 | from py3compat import *
  |
info: Searched in the following paths during module resolution:
info:   1. /Users/micha/astral/test (first-party code)
info:   2. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   3. /Users/micha/astral/test/.venv/lib/python3.10/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `py3compat`
 --> 444/lib.py:2:6
  |
1 | from binary import *
2 | from py3compat import *
  |      ^^^^^^^^^
  |
info: Searched in the following paths during module resolution:
info:   1. /Users/micha/astral/test (first-party code)
info:   2. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   3. /Users/micha/astral/test/.venv/lib/python3.10/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `construct`
 --> 444/mre.py:3:6
  |
1 | from io import BytesIO
2 |
3 | from construct import Float32l
  |      ^^^^^^^^^
  |
info: Searched in the following paths during module resolution:
info:   1. /Users/micha/astral/test (first-party code)
info:   2. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   3. /Users/micha/astral/test/.venv/lib/python3.10/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

Found 3 diagnostics

@MichaReiser MichaReiser added cli Related to the command-line interface ty Multi-file analysis & type inference labels Oct 24, 2025
@MichaReiser MichaReiser requested review from ibraheemdev and removed request for carljm, dcreager and sharkdp October 24, 2025 08:21
@github-actions
Copy link
Contributor

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@github-actions
Copy link
Contributor

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

@MichaReiser MichaReiser changed the title [ty] Fix missing newline after progress bar [ty] Fix missing newline before first diagnostic Oct 24, 2025
@MichaReiser MichaReiser merged commit f36fa7d into main Oct 24, 2025
43 checks passed
@MichaReiser MichaReiser deleted the micha/fix-newline-after-progress branch October 24, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli output is missing a newline

3 participants