Conversation
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
==========================================
+ Coverage 86.77% 87.82% +1.04%
==========================================
Files 7 7
Lines 242 271 +29
==========================================
+ Hits 210 238 +28
- Misses 32 33 +1
Continue to review full report at Codecov.
|
86b582b to
0e2c48b
Compare
0e2c48b to
0b99e5b
Compare
|
The parser on master doesn't handle lines with unterminated For example: So this shouldn't break anything that was previously working The implementation provided in this PR won't handle cases such as below, but I'm not sure people would expect it to On a related note, whilst experimenting I found that the parser on master doesn't handle escapes within |
pksunkara
left a comment
There was a problem hiding this comment.
Looks great. Very reasonable solution too!
| match self.buf.read_line(&mut buf) { | ||
| Ok(0) => return None, | ||
| Ok(_n) => { | ||
| if is_complete(&buf) { |
There was a problem hiding this comment.
This looks to me like it would cause an exponential slowdown if a quote contained a large number of lines - it would have to loop through every character read so far for each new line.
Would it be possible to make this a stateful parser which keeps track of what quotes have been seen so far, and only looks at each character once be possible without making it significantly more complicated?
I mean, the current code won't slow down any current use cases, and env variables are unlikely to be very large. But it seems non-ideal to have an exponential slowdown if it's avoidable?
I'm asking as an observer: I don't have any ownership over dotenv.
|
superseded by allan2/dotenvy#3 |
dotenv appears unmaintained and [does not support multiline values](dotenv-rs/dotenv#63) yet. Replace this with a the well maintained fork [dotenvy](https://crates.io/crates/dotenvy). ## Testing Ran `scope doctor run` locally and confirmed it successfully reads multi-line env vars correctly.
Fixes #40