Fix editorconfig parseSync option #387 - #394
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #394 +/- ##
==========================================
- Coverage 99.68% 99.68% -0.01%
==========================================
Files 7 7
Lines 320 319 -1
Branches 90 95 +5
==========================================
- Hits 319 318 -1
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes the .editorconfig integration in Validator to address issue #387 by changing how the EditorConfig library is invoked so it no longer depends on process.cwd() being within the target project.
Changes:
- Add Node’s
pathmodule to support filename extraction. - Replace the previous CWD-based “relative path” logic with
path.basename(...)when passingconfigtoeditorconfig.parseSync().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7a9d837 to
c979a9f
Compare
|
Are we all good or is there anything else to clarify or modify ? |
|
Hi @Bartheleway, I am a bit busy and haven't really managed to have a deeper look yet. But I promise to do it soon. I am wondering at first sight if we still need all these path checks, or if we can simply forward the value into editorconfig... |
| it('should allow working from another directory', () => { | ||
| const originalCwd = cwd(); | ||
|
|
||
| chdir(path.resolve(__dirname, '__fixtures__/deep')); | ||
|
|
There was a problem hiding this comment.
Should I fix? I feel that it will not cause damage even if test fails.
schorfES
left a comment
There was a problem hiding this comment.
Hi @Bartheleway,sorry for the long waiting...
From what I see now, I am pretty sure we can simplify a few things and adjust the tests accordingly. From my point of view, I would just pass a valid value for the editorconfig filename into the option and let editorconfig do the rest.
Thanks in advance for your collaboration, looking forward to your thoughts!
c979a9f to
5b4dc12
Compare
5b4dc12 to
a62a0ab
Compare
Fix #387