ruff
417b3991 - [ty] show final search path instead of "and 1 more paths" (#22776)

Commit
22 hours ago
[ty] show final search path instead of "and 1 more paths" (#22776) ## Summary If there are six search paths, five are attached as subdiagnostic of unresolved imports but the sixth is by default hidden and replaced by "... and 1 more paths. Run with `-v` to see all paths." ``` info: Searched in the following paths during module resolution: info: 1. <temp_dir>/extra1 (extra search path specified on the CLI or in your config file) info: 2. <temp_dir>/extra2 (extra search path specified on the CLI or in your config file) info: 3. <temp_dir>/extra3 (extra search path specified on the CLI or in your config file) info: 4. <temp_dir>/extra4 (extra search path specified on the CLI or in your config file) info: 5. <temp_dir>/ (first-party code) info: ... and 1 more paths. Run with `-v` to see all paths. ``` By hiding a single path this truncation does not shorten the output but still requires the user to rerun ty. We can just include the final search path instead. The subdiagnostic "and 1 more paths" isn't helpful - we can show the hidden path instead (and still have the same number of subdiagnistics). ``` info: Searched in the following paths during module resolution: info: 1. <temp_dir>/extra1 (extra search path specified on the CLI or in your config file) info: 2. <temp_dir>/extra2 (extra search path specified on the CLI or in your config file) info: 3. <temp_dir>/extra3 (extra search path specified on the CLI or in your config file) info: 4. <temp_dir>/extra4 (extra search path specified on the CLI or in your config file) info: 5. <temp_dir>/ (first-party code) info: 6. vendored://stdlib (stdlib typeshed stubs vendored by ty) ``` ## Test Plan * cargo test extended * manual invocation (with the configuration that prompted me to propose this change).
Author
Parents
Loading