-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
util: fix parseEnv handling of invalid lines #56778
util: fix parseEnv handling of invalid lines #56778
Conversation
de3dd86
to
8dd566f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Even though this test pass, I strongly recommend adding as much as comment possible while simplifying your code. Our parser is already complex (due to not using a regex) and it would help a lot if we know why such decision is taken in the parser.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56778 +/- ##
==========================================
- Coverage 90.23% 90.23% -0.01%
==========================================
Files 630 630
Lines 185288 185295 +7
Branches 36344 36339 -5
==========================================
- Hits 167203 167199 -4
- Misses 11006 11009 +3
- Partials 7079 7087 +8
🚀 New features to boost your workflow:
|
Yup yagizz, I had tried to apply yours suggestions. I'm reaching my limit in C++. So I hope that this time if it's good. |
I see lots of changes unrelated to your PR. Can you revert everything that is unrelated to your change? |
Bump @anonrig 👋 |
@AugustinMauroy the tests are failing |
How to run test that fail ?? I din't get what should I do |
@aduh95 Maybe you could help here? The failure is specific to directories with special chars. |
51d9aad
to
2a6ba9d
Compare
This should work if it is a specific js test for more: |
Thanks mert 🫶🏻 |
const input = fs.readFileSync(${JSON.stringify(invalidEnvFilePath)}, 'utf8'); | ||
assert.deepStrictEqual(util.parseEnv(input), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Wouldn't it make more sense to put the content here rather in a fixture file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of tests use an fixture so I just do it as same
093636d
to
2f90eb1
Compare
@anonrig any new ? |
I will take a look at it soon, but I'm unblocking in case there is someone who can review this faster.
This needs a rebase to fix the conflict |
I'll do that ! |
4f58de5
to
17c65d1
Compare
This PR fixes an issue with
util.parseEnv()
where invalid lines in the input were being incorrectly concatenated into key names instead of being skipped. The fix ensures that lines without an equals sign are properly skipped during parsingFixes: #56775