fix(add): include pyproject.toml path in "already present" message#10908
Open
SarthakB11 wants to merge 2 commits into
Open
fix(add): include pyproject.toml path in "already present" message#10908SarthakB11 wants to merge 2 commits into
SarthakB11 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
notify_about_existing_packages, consider avoiding the two adjacent f-strings and instead build the message as a single f-string or via.format()to improve readability and make the linter’s job easier. - The tests interpolate
app.poetry.file.path, which may be an absolute path; if the CLI output is intended to show a path relative to the current working directory, you might want to normalize it in the command code (and reflect that in the assertions) for more user-friendly output.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `notify_about_existing_packages`, consider avoiding the two adjacent f-strings and instead build the message as a single f-string or via `.format()` to improve readability and make the linter’s job easier.
- The tests interpolate `app.poetry.file.path`, which may be an absolute path; if the CLI output is intended to show a path relative to the current working directory, you might want to normalize it in the command code (and reflect that in the assertions) for more user-friendly output.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
… path Same message change as the main add command; this test was missed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Check List
Resolves: #10179
The "already present in the pyproject.toml and will be skipped" notice doesn't say which
pyproject.toml. Withpoetry self add, a poetry-managed project next to your own, or any non-cwd invocation, you have to go grep for the file.notify_about_existing_packagesnow includesself.poetry.file.pathin the message, styled with the same<c2>markup theaddcommand uses elsewhere for paths. The two assertions intests/console/commands/test_add.pywere updated to interpolate the fixture's path.