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

Use relative path for error messages. #708

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

gdotdesign
Copy link
Member

This PR changes the paths of the snippets in error messages to be relative to the project root - the directory where mint.json file is. This makes it easier to find since we don't need to read the whole path.

From this:

   ┌ /path/to/project/source/Main.mint:3:7
   ├──────────────────────────────────────

To this:

   ┌ source/Main.mint:3:7
   ├──────────────────────────────────────

The only relevant change is in src/errorable.cr, the other ones are just snapshot updates for tests.

@gdotdesign gdotdesign added the enhancement New feature or request label Nov 21, 2024
@gdotdesign gdotdesign added this to the 0.21.0 milestone Nov 21, 2024
@gdotdesign gdotdesign requested a review from Sija November 21, 2024 08:52
@gdotdesign gdotdesign self-assigned this Nov 21, 2024
Copy link
Member

@Sija Sija left a comment

Choose a reason for hiding this comment

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

I can't find the changed code in question because of the massive diff from the snapshots. Could you please split the commit in two - one with the change itself and one with the snapshot updates?

@gdotdesign
Copy link
Member Author

Pretty small diff: value.file.path -> value.file.relative_path

image

@gdotdesign gdotdesign merged commit 2b6c183 into master Nov 22, 2024
3 checks passed
@gdotdesign gdotdesign deleted the relative-filenames-in-errors branch November 22, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants