-
Notifications
You must be signed in to change notification settings - Fork 3.5k
{Style} Refine style framework #16258
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0d673e9
Disable blue in powershell
20847a2
no_color
559e6bb
Add comments
325e9c4
Add tests
3962cc6
Add tests for get_parent_proc_name
48a88bb
Use style for survey prompt
d185678
Cache get_parent_proc_name
869ba5f
CI
98b6c61
Send kwargs to print
0945bad
Light theme support
cad3673
Use default foreground color for PRIMARY
cbbca7f
Use foreground for powershell.exe
a44184c
Detect modern terminal
0179277
Merge branch 'dev' into style-color
b1c28d8
is_legacy_powershell
7ec53fb
tests
fa9985e
Remove no_color
2d62d81
Add comments for print_styled_text
1e55d33
Merge branch 'dev' into style-color
6240eaf
Theme Enum
9f89e0f
Fix test when no tty
36a1e9f
pwsh in linux
95dbeeb
style
df6d6e7
Merge branch 'dev' into style-color
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask why do we need to support the case that
themeis string?By the way, could we consider setting a theme configuration as a enum for this mapping relationship instead of
if-elselogic? Such as:If this enum is used as parameter, I personally think it is more readable and easier maintained~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because everything passed to CLI via the shell will be treated as
str.Moreover, the
values of anEnumare usually basic types likestrorint. Usingdictas the value, likewill result in:
But the idea of using
EnumforThemeis good. Added as requested:azure-cli/src/azure-cli-core/azure/cli/core/style.py
Lines 67 to 77 in 6240eaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK