Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhance readability of .python-version#1105

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@lmvysakh
Copy link

@lmvysakhlmvysakh commentedMay 14, 2025
edited
Loading

Enhance reading from .python-version file, matching the Pyenv behavior:

We extend our thanks to@krystof-k for the valuable contribution in implementing this feature in PR#787. To expedite its availability to users, we have created this PR, which incorporates the same changes while addressing the CI issues that had previously delayed the merge of PR#787.

Check list:

  • Tests were added or updated to cover the changes.

CopilotAI review requested due to automatic review settingsMay 14, 2025 11:10
@lmvysakhlmvysakh requested a review froma team as acode ownerMay 14, 2025 11:10
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR improves the readability and functionality when reading the .python-version file by supporting multiple versions, handling pyenv-virtualenv pointers, ignoring comments and empty lines, and trimming whitespace.

  • Updated the function name and logic in utils.ts to process multiple lines.
  • Refactored setup-python.ts and updated tests intests/utils.test.ts to integrate the new behavior.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
src/utils.tsRenamed and updated function to support multi-line version files and pointer handling.
src/setup-python.tsUpdated import and usage to reflect the new function name.
tests/utils.test.tsAdded tests for multi-line files and updated expected outcomes.

Comment on lines +284 to +287
if(line.startsWith('#')||line.trim()===''){
returnundefined;
}
letversion:string=line.trim();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

[nitpick] Consider caching the result of line.trim() in a variable to avoid calling trim() multiple times within the mapping function.

Suggested change
if(line.startsWith('#')||line.trim()===''){
returnundefined;
}
letversion:string=line.trim();
consttrimmedLine=line.trim();
if(line.startsWith('#')||trimmedLine===''){
returnundefined;
}
letversion:string=trimmedLine;

Copilot uses AI. Check for mistakes.
@krystof-kkrystof-k mentioned this pull requestMay 14, 2025
2 tasks
@lmvysakh
Copy link
Author

The relevant changes and improvements proposed here have already been addressed and implemented in PR#787. Hence, this PR is now superseded by#787, which provides a more comprehensive solution for the scenarios discussed. Therefore, we are closing this pull request.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@lmvysakh@priya-kinthali

[8]ページ先頭

©2009-2025 Movatter.jp