{CI} Fix all style errors for pylint 4.x compatibility#33347
{CI} Fix all style errors for pylint 4.x compatibility#33347YangAn-microsoft wants to merge 3 commits into
Conversation
… duplicate functions, codecs.open migration)
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull request overview
This PR updates Azure CLI source to pass azdev style --pylint under pylint 4.x (notably on Python 3.14), primarily by addressing logging-format issues, removing duplicate function definitions, and updating deprecated file-reading usage.
Changes:
- Fix logging calls to use parameterized formatting compatible with pylint 4.x checks.
- Remove duplicate helper function definitions flagged by pylint (keeping the canonical definitions).
- Replace
codecs.openwith built-inopen(..., encoding=...)in core file-reading utility.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/synapse/manual/operations/sqlpoolblobauditingpolicy.py | Removes a duplicate diagnostic-settings helper implementation. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py | Removes a duplicate _handle_exists_exception helper definition. |
| src/azure-cli/azure/cli/command_modules/containerapp/_utils.py | Removes a duplicate _remove_env_vars definition, keeping a single implementation. |
| src/azure-cli/azure/cli/command_modules/botservice/custom.py | Adjusts log messages and fixes a logging call to be properly parameterized. |
| src/azure-cli/azure/cli/command_modules/batch/_command_type.py | Tweaks Optional/Union(None) type-hint handling to satisfy pylint 4.x. |
| src/azure-cli/azure/cli/command_modules/appservice/custom.py | Removes an unnecessary _list_app import (function is defined locally). |
| src/azure-cli/azure/cli/command_modules/apim/custom.py | Fixes an incorrect logger.warning format string/arguments pairing. |
| src/azure-cli-core/azure/cli/core/util.py | Replaces deprecated codecs.open usage with built-in open and explicit encodings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try: | ||
| # Extract the link from the response where results are stored | ||
| link = response_dict['additional_properties']['properties']['value']['link'] | ||
| except KeyError: | ||
| logger.warning("Error exporting api from APIManagement. The expected link is not present in the response.") | ||
| return |
| return | ||
| except requests.exceptions.ReadTimeout: | ||
| logger.warning("Timed out while exporting api from APIManagement.") | ||
| return |
This PR contains Azure CLI code changes required to pass style checks with pylint 4.x.
What is included
Scope
Coordination