Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print relative paths in crystal tool unreachable #13929

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Nov 1, 2023

This patch relativizes paths in the output of crystal tool unreachable using Path#relative_to. The result is a more concise display without losing information.

Before:

/home/johannes/src/crystal-lang/crystal/foobar.cr:1:1     top-level foo   3 lines
/home/johannes/src/crystal-lang/crystal/foobar.cr:7:1     top-level foo   3 lines
/home/johannes/src/crystal-lang/crystal/foobar.cr:13:1    top-level bar   3 lines

After:

foobar.cr:1:1     top-level foo   3 lines
foobar.cr:7:1     top-level foo   3 lines
foobar.cr:13:1    top-level bar   3 lines

crystal tool dependencies uses the same mechanic already.

@straight-shoota straight-shoota added this to the 1.11.0 milestone Nov 4, 2023
@straight-shoota straight-shoota merged commit 97d9eb4 into crystal-lang:master Nov 5, 2023
54 of 55 checks passed
@straight-shoota straight-shoota deleted the feat/unreachable-relative_paths branch November 5, 2023 17:59
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants