Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

extend --shorten-paths; highlight path segments #210

Merged
merged 7 commits into from
May 20, 2021
Merged

Conversation

japaric
Copy link
Member

@japaric japaric commented May 20, 2021

this commit extends --shorten-paths so it now also handles:

  • /rustc paths
  • rust-std paths

it also adds highlighting to paths when --shorten-paths is not used

without --shorten-paths
Screenshot from 2021-05-20 14-34-44

with --shorten-paths
Screenshot from 2021-05-20 14-34-27

closes #66

japaric added 4 commits May 20, 2021 15:04
this commit extends `--shorten-paths` so it now also handles:
- `/rustc` paths
- `rust-std` paths

it also adds highlighting to paths when `--shorten-paths` is not used

assert_eq!(expected, path);

let expected_str = "[stable]/library/core/src/sync/atomic.rs";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the picture in the PR description doesn't show how a rust-std path is compressed but this test does

use rstest::rstest;

#[rstest]
#[case("stable-x86_64-unknown-linux-gnu", Channel::Stable, "stable")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the picture in the PR description doesn't show how a rust-std path is compressed but this test does

and this is how the toolchains are shortened with --shorten-paths

Copy link
Member

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏾

src/dep/mod.rs Outdated Show resolved Hide resolved
src/dep/rust_repo.rs Outdated Show resolved Hide resolved
src/dep/cratesio.rs Show resolved Hide resolved
src/dep/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Johann Hemmann <johann.hemmann@code.berlin>
@Urhengulas
Copy link
Member

Looks good to me and I like the shortening! 😄

I think I would like to have this enabled per default and a flag for printing the long paths, but this is a story for another PR :D

@japaric
Copy link
Member Author

japaric commented May 20, 2021

bors r=Urhengulas

@bors bors bot merged commit 48f9b9a into main May 20, 2021
@bors bors bot deleted the highlight-path-segments branch May 20, 2021 19:08
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

backtrace: Shorten paths to crates/libcore
2 participants