Add pyenv locator#14587
Conversation
Codecov Report
@@ Coverage Diff @@
## main #14587 +/- ##
==========================================
+ Coverage 64.90% 65.07% +0.17%
==========================================
Files 541 541
Lines 25144 25377 +233
Branches 3545 3587 +42
==========================================
+ Hits 16320 16515 +195
- Misses 8162 8179 +17
- Partials 662 683 +21
Continue to review full report at Codecov.
|
| let specificity = getPythonVersionSpecificity(version); | ||
| for (const v of pythonVersions) { | ||
| if (v) { | ||
| const curSpecificity = getPythonVersionSpecificity(v); |
There was a problem hiding this comment.
Can you use comparePythonVersionSpecificity and not export getPythonVersionSpecificity at all?
There was a problem hiding this comment.
getPythonVersionSpecificity is still being exported.
| .map((p) => allParsers.get(p)) | ||
| .filter((p) => p !== undefined); | ||
|
|
||
| if (parsers.length > 0 && parsers[0]) { |
There was a problem hiding this comment.
| if (parsers.length > 0 && parsers[0]) { | |
| if (parsers.length > 0) { |
Will this work?
There was a problem hiding this comment.
Nope. Even though we filter out undefined, TS thinks that parsers[0] can be undefined.
There was a problem hiding this comment.
If you use the .map as I suggested above you should be able to get rid of parsers[0] check.
| * Wn > Wn-1 + Wn-2 + ... W0 | ||
| */ | ||
| function getPythonVersionInfoHeuristic(version: PythonVersion): number { | ||
| export function getPythonVersionSpecificity(version: PythonVersion): number { |
| const parsers = knownPrefixes | ||
| .filter((k) => str.startsWith(k)) | ||
| .map((p) => allParsers.get(p)) | ||
| .filter((p) => p !== undefined); |
There was a problem hiding this comment.
| .filter((p) => p !== undefined); | |
| .filter((p) => p !== undefined); | |
| .map((p) => p!); |
There was a problem hiding this comment.
@karthiknadig However small the comments are, I expect them to be resolved or replied to before merging, when I do approve.
| .map((p) => allParsers.get(p)) | ||
| .filter((p) => p !== undefined); | ||
|
|
||
| if (parsers.length > 0 && parsers[0]) { |
There was a problem hiding this comment.
If you use the .map as I suggested above you should be able to get rid of parsers[0] check.
|
Kudos, SonarCloud Quality Gate passed!
|
No description provided.