-
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
{Misc.} Improve code style and prepare for pylint 3 #29373
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Misc. |
@@ -182,8 +182,7 @@ def __len__(self): | |||
return len(self._data) | |||
|
|||
def __iter__(self): | |||
for key in self._data: | |||
yield key | |||
yield from self._data |
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.
src/azure-cli-core/azure/cli/core/aaz/_field_value.py:185:8: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from)
@@ -326,8 +325,7 @@ def __init__(self, schema, data): | |||
self._len = 0 | |||
if self._data is not None and self._data != AAZUndefined: | |||
for idx in self._data: | |||
if idx + 1 > self._len: | |||
self._len = idx + 1 | |||
self._len = max(self._len, idx + 1) |
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.
src/azure-cli-core/azure/cli/core/aaz/_field_value.py:329:16: R1731: Consider using '_len = max(_len, idx + 1)' instead of unnecessary if block (consider-using-max-builtin)
@@ -166,9 +166,9 @@ def update_search_service(instance, partition_count=0, replica_count=0, public_n | |||
|
|||
replica_count = int(replica_count) | |||
partition_count = int(partition_count) | |||
if replica_count > 0: | |||
if replica_count > 0: # pylint: disable=consider-using-min-builtin | |||
instance.replica_count = replica_count |
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.
consider-using-min-builtin
should not be raised.
See pylint-dev/pylint#9800
pylint-dev/pylint#9800 was fixed and the fix will be available in next release. |
Thanks for the quick fix. Do you have a schedule for the next release? |
No I don't, but it seems reasonable to say that it will be released shortly, seeing that the milestone has no open issues left and releases are done in 2-3 weeks and the last release was 3 weeks ago. |
@@ -53,6 +53,8 @@ disable= | |||
superfluous-parens, | |||
implicit-str-concat, | |||
unnecessary-dunder-call, | |||
# These rules were added in Pylint >= 3.2 | |||
possibly-used-before-assignment, |
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.
This rule is hard to fix and make the code hard to read.
@kamperiadis Please help review the App Service related code |
@zubairabid Please help review the Backup related code |
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.
Changes in backup code look good to me.
Prepare for Azure/azure-cli-dev-tools#458