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

Fix diagnostics printing when pwd() doesn't exist #373

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

c42f
Copy link
Member

@c42f c42f commented Oct 28, 2023

Computing the file URL for pretty printing using abspath can fail when the current working directory doesn't exist. This is a quick fix for this issue (which is incredibly confusing/disruptive if the user does manage to enter a nonexistant working directory!)

A more complete fix would avoid ever looking at the working directory when printing diagnostics, instead requiring the caller to pass in a richer definition of the "location of source code" than the mere file name as a string. However getting something sensible working there is (a) breaking and (b) unclear on may details. So just patching this up quickly seems good for now.

Fix #359

Computing the file URL for pretty printing using `abspath` can fail when
the current working directory doesn't exist. This is a quick fix for
this issue (which is incredibly confusing/disruptive if the user does
manage to enter a nonexistant working directory!)

A more complete fix would avoid ever looking at the working directory
when printing diagnostics, instead requiring the caller to pass in a
richer definition of the "location of source code" than the mere file
name as a string. However getting something sensible working there is
(a) breaking and (b) unclear on may details. So just patching this up
quickly seems good for now.
@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Merging #373 (4ac765c) into main (1b048aa) will decrease coverage by 0.03%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
- Coverage   96.58%   96.56%   -0.03%     
==========================================
  Files          14       14              
  Lines        4160     4164       +4     
==========================================
+ Hits         4018     4021       +3     
- Misses        142      143       +1     
Files Coverage Δ
src/diagnostics.jl 93.18% <90.00%> (-1.82%) ⬇️

@c42f c42f merged commit 4d990b6 into main Oct 29, 2023
31 of 32 checks passed
@c42f c42f deleted the caf/fix-pwd-diagnostics-fail branch October 29, 2023 06:38
c42f added a commit that referenced this pull request Nov 12, 2023
Computing the file URL for pretty printing using `abspath` can fail when
the current working directory doesn't exist. This is a quick fix for
this issue (which is incredibly confusing/disruptive if the user does
manage to enter a nonexistant working directory!)

A more complete fix would avoid ever looking at the working directory
when printing diagnostics, instead requiring the caller to pass in a
richer definition of the "location of source code" than the mere file
name as a string. However getting something sensible working there is
(a) breaking and (b) unclear on may details. So just patching this up
quickly seems good for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pwd might not exist causing errors when trying to print diagnostics
1 participant