Add --list-profiles command line argument#2319
Closed
CasP0 wants to merge 1 commit intoPyCQA:mainfrom
Closed
Conversation
Add a new command line argument `--list-profiles` to the argument parser in `isort/main.py`. * **Argument Parser Changes** - Add `--list-profiles` argument to the general group. - Implement logic to print the available profiles and exit if `--list-profiles` is provided. * **Test Case Addition** - Add a new test case in `tests/unit/test_main.py` to verify that `--list-profiles` prints the available profiles.
kurtmckee
suggested changes
Jan 11, 2025
| output_group.add_argument( | ||
| "--cs", | ||
| "--combine-star", | ||
| dest="combine_star", |
Contributor
There was a problem hiding this comment.
This was removed but not added back in as other arguments were.
Comment on lines
-1013
to
+1018
| uniqueness.add_argument( | ||
| uniqueness.add.argument( |
Contributor
There was a problem hiding this comment.
It looks like this changed from an underscore to a period. Was this intended?
|
|
||
| if arguments.get("list_profiles"): | ||
| print("Available profiles:") | ||
| for profile in profiles.keys(): |
Contributor
There was a problem hiding this comment.
Nit -- no need to call .keys() as dictionary iterate over their keys by default. 👍
for profile in profiles:
print(f"- {profile}")
Member
|
Considering there is also no issue for this, I'll close this for now. |
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.
Add a new command line argument
--list-profilesto the argument parser inisort/main.py.Argument Parser Changes
--list-profilesargument to the general group.--list-profilesis provided.Test Case Addition
tests/unit/test_main.pyto verify that--list-profilesprints the available profiles.