-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{Pylint} Fix implicit-str-concat #30363
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
src/azure-cli/azure/cli/command_modules/cdn/custom/custom_rule_util.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/relay/tests/latest/test_relay_commands.py
Outdated
Show resolved
Hide resolved
@@ -1136,7 +1136,7 @@ def load_arguments(self, _): | |||
c.argument('subnet_address_prefix', help='The subnet IP address prefix to use when creating a new VNet in CIDR format.') | |||
c.argument('nics', nargs='+', help='Names or IDs of existing NICs to attach to the VM. The first NIC will be designated as primary. If omitted, a new NIC will be created. If an existing NIC is specified, do not specify subnet, VNet, public IP or NSG.') | |||
c.argument('private_ip_address', help='Static private IP address (e.g. 10.0.0.5).') | |||
c.argument('public_ip_address', help='Name of the public IP address when creating one (default) or referencing an existing one. Can also reference an existing public IP by ID or specify "" for None (\'""\' in Azure CLI using PowerShell or --% operator). For Azure CLI using powershell core edition 7.3.4, specify '' or "" (--public-ip-address '' or --public-ip-address "")') | |||
c.argument('public_ip_address', help='Name of the public IP address when creating one (default) or referencing an existing one. Can also reference an existing public IP by ID or specify "" for None (\'""\' in Azure CLI using PowerShell or --% operator). For Azure CLI using powershell core edition 7.3.4, specify or "" (--public-ip-address or --public-ip-address "")') |
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.
c.argument('public_ip_address', help='Name of the public IP address when creating one (default) or referencing an existing one. Can also reference an existing public IP by ID or specify "" for None (\'""\' in Azure CLI using PowerShell or --% operator). For Azure CLI using powershell core edition 7.3.4, specify or "" (--public-ip-address or --public-ip-address "")') | |
c.argument('public_ip_address', help='Name of the public IP address when creating one (default) or referencing an existing one. Can also reference an existing public IP by ID or specify "" for None (\'""\' in Azure CLI using PowerShell or --% operator). For Azure CLI using powershell core edition 7.3.4, specify or "" (--public-ip-address or --public-ip-address "")') |
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.
The '
character is missing. The help message is also not correct. In powershell, the empty string shoule be represented as '""'
.
src/azure-cli/azure/cli/command_modules/relay/tests/latest/test_relay_commands.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Jiashuo Li <4003950+jiasli@users.noreply.github.com>
src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@@ -438,7 +438,7 @@ def load_arguments(self, _): | |||
c.argument('dapr_enable_api_logging', options_list=['--dapr-enable-api-logging', '--dal'], help="Enable/Disable API logging for the Dapr sidecar.", arg_type=get_three_state_flag(return_label=True)) | |||
c.argument('workload_profile_name', help="The name of the workload profile to run the app on.", is_preview=True) | |||
c.argument('cpu', type=float, help="Required CPU in cores from 0.5 to 2.0.", is_preview=True) | |||
c.argument('memory', help="Required momory from 1.0 to 4.0 ending with ""Gi"" e.g. 1.0Gi, ", is_preview=True) | |||
c.argument('memory', help="Required momory from 1.0 to 4.0 ending with Gi e.g. 1.0Gi, ", is_preview=True) |
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.
I guess the author wants to quote Gi
:
c.argument('memory', help="Required momory from 1.0 to 4.0 ending with Gi e.g. 1.0Gi, ", is_preview=True) | |
c.argument('memory', help='Required momory from 1.0 to 4.0 ending with "Gi" e.g. 1.0Gi, ', is_preview=True) |
@@ -292,7 +292,7 @@ def create_action(action_name, cache_behavior=None, cache_duration=None, header_ | |||
action = { | |||
"cache_key_query_string": { | |||
"parameters": { | |||
"type_name" "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" | |||
"type_name": "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters", |
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.
Can't imagine how the code still works while it is as wrong as such.
@@ -42,17 +42,17 @@ def load_arguments(self, _): | |||
'namespace', | |||
completer=get_providers_completion_list, | |||
arg_group='Resource ID', | |||
help='Provider namespace (Ex: ''Microsoft.Provider'').') | |||
help='Provider namespace (Ex: Microsoft.Provider).') |
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.
I think the author actually wants to quote Microsoft.Provider
, but used the PowerShell syntax:
> echo "a""b"
a"b
> echo 'a''b'
a'b
help='Provider namespace (Ex: Microsoft.Provider).') | |
help="Provider namespace (Ex: 'Microsoft.Provider').") |
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.
Should the following three help messages be kept consistent? Personally, I think when parentheses are used, having or not having double quotes is fine.
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.
Let's not assume what the author wants to quote. Just merge this PR and let the author change it in the future.
Fix this with
ruff check . --select ISC001 --fix
superfluous-parens was disabled in #26685
Ref:
https://pylint.readthedocs.io/en/stable/user_guide/messages/warning/implicit-str-concat.html
https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/