-
Notifications
You must be signed in to change notification settings - Fork 125
Bump Pylint to 2.17 and flake8 to 6.0 #359
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
Changes from 28 commits
ac7c673
44c36ee
d4070e8
1928f29
c60042d
3a22e88
87cb41c
2fd99af
998a0bc
4cd84e7
7a2c4fe
a4bb458
0fa543d
a071b95
1028936
d207de8
23cb1db
ec84363
513539f
664c6c8
074f8aa
510f0c1
f07822b
a4623ce
ae28381
53f9b3d
4d2e2a5
0e60fba
f80f150
08e6383
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,20 @@ | |
| max-line-length = 120 | ||
| max-complexity = 10 | ||
| ignore = | ||
| E501, # line too long, it is covered by pylint | ||
| E722, # bare except, bad practice, to be removed in the future | ||
| F401, # imported but unused, too many violations, to be removed in the future | ||
| F811, # redefinition of unused, to be removed in the future | ||
| C901 # code flow is too complex, too many violations, to be removed in the future | ||
| W503 # line break before binary operator | ||
| W504 # line break after binary operator effect on readability is subjective | ||
| # line too long, it is covered by pylint | ||
| E501, | ||
|
Comment on lines
+5
to
+6
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason for reformatting?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because flake8 upgrade to 6.0. Flake8 6.0 does not support inline comments for any of the keys, so comments should be put in newline. Related issue: PyCQA/flake8#1750 Azure/azure-cli#25370
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When After upgrading PyLint 2.7,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this issue still exist in pylint 2.17.4? https://pypi.org/project/pylint/
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When run |
||
| # bare except, bad practice, to be removed in the future | ||
| E722, | ||
| # imported but unused, too many violations, to be removed in the future | ||
| F401, | ||
| # redefinition of unused, to be removed in the future | ||
| F811, | ||
| # code flow is too complex, too many violations, to be removed in the future | ||
| C901, | ||
| # line break before binary operator | ||
| W503, | ||
| # line break after binary operator effect on readability is subjective | ||
| W504 | ||
| exclude = | ||
| azure_cli_bdist_wheel.py | ||
| build | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,11 @@ disable= | |
| useless-import-alias, | ||
| useless-suppression, | ||
| import-outside-toplevel, | ||
| wrong-import-order | ||
| wrong-import-order, | ||
| # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change | ||
| broad-exception-raised, | ||
| deprecated-module, | ||
| missing-timeout | ||
|
|
||
| [FORMAT] | ||
| max-line-length=120 | ||
|
|
@@ -50,13 +54,13 @@ min-similarity-lines=10 | |
| # The invalid-name checker must be **enabled** for these hints to be used. | ||
| include-naming-hint=yes | ||
|
|
||
| module-name-hint=lowercase (keep short; underscores are discouraged) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am actually curious how
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hint is shown in the I've removed all xxx-hint settings. See Azure/azure-cli#26685 (comment) and #359 (comment) |
||
| const-name-hint=UPPER_CASE_WITH_UNDERSCORES | ||
| class-name-hint=CapitalizedWords | ||
| class-attribute-name-hint=lower_case_with_underscores | ||
| attr-name-hint=lower_case_with_underscores | ||
| method-name-hint=lower_case_with_underscores | ||
| function-name-hint=lower_case_with_underscores | ||
| argument-name-hint=lower_case_with_underscores | ||
| variable-name-hint=lower_case_with_underscores | ||
| inlinevar-name-hint=lower_case_with_underscores (short is OK) | ||
| module-naming-style=snake_case | ||
| const-naming-style=UPPER_CASE | ||
| class-naming-style=PascalCase | ||
| class-attribute-naming-style=snake_case | ||
| attr-naming-style=snake_case | ||
| method-naming-style=snake_case | ||
| function-naming-style=snake_case | ||
| argument-naming-style=snake_case | ||
| variable-naming-style=snake_case | ||
| inlinevar-naming-style=snake_case | ||
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -37,13 +37,13 @@ def handle_signature(self, sig, signode): | |||||
| signode += addnodes.desc_addname(sig, sig) | ||||||
| return sig | ||||||
|
|
||||||
| def needs_arglist(self): # pylint: disable=no-self-use | ||||||
| def needs_arglist(self): | ||||||
| return False | ||||||
|
|
||||||
| def add_target_and_index(self, name, sig, signode): | ||||||
| signode['ids'].append(name) | ||||||
|
|
||||||
| def get_index_text(self, modname, name): # pylint: disable=unused-argument, no-self-use | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise it raises
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pylint apparently doesn't think |
||||||
| def get_index_text(self, modname, name): # pylint: disable=unused-argument | ||||||
| return name | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -53,7 +53,7 @@ class CliGroupDirective(CliBaseDirective): | |||||
| Field('docsource', label='Doc Source', has_arg=False, | ||||||
| names=('docsource', 'documentsource')), | ||||||
| Field('deprecated', label='Deprecated', has_arg=False, | ||||||
| names=('deprecated')) | ||||||
| names=('deprecated',)) | ||||||
| ]) | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -63,23 +63,23 @@ class CliCommandDirective(CliBaseDirective): | |||||
| Field('docsource', label='Doc Source', has_arg=False, | ||||||
| names=('docsource', 'documentsource')), | ||||||
| Field('deprecated', label='Deprecated', has_arg=False, | ||||||
| names=('deprecated')) | ||||||
| names=('deprecated',)) | ||||||
| ]) | ||||||
|
|
||||||
|
|
||||||
| class CliArgumentDirective(CliBaseDirective): | ||||||
| doc_field_types = copy.copy(_CLI_FIELD_TYPES) | ||||||
| doc_field_types.extend([ | ||||||
| Field('required', label='Required', has_arg=False, | ||||||
| names=('required')), | ||||||
| names=('required',)), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the semantics of the code. Better to confirm if it is required or works as expected.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Why is this type error never found?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I comfirm this is a typo, as next line it becomes a tuple: azure-cli-dev-tools/azdev/operations/help/refdoc/common/directives.py Lines 75 to 76 in cabbb3e
|
||||||
| Field('values', label='Allowed values', has_arg=False, | ||||||
| names=('values', 'choices', 'options')), | ||||||
| Field('default', label='Default value', has_arg=False, | ||||||
| names=('default')), | ||||||
| names=('default',)), | ||||||
| Field('source', label='Values from', has_arg=False, | ||||||
| names=('source', 'sources')), | ||||||
| Field('deprecated', label='Deprecated', has_arg=False, | ||||||
| names=('deprecated')) | ||||||
| names=('deprecated',)) | ||||||
| ]) | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
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.
deprecated-moduleis quite useful and there is a few errors.I prefer to enable it by default.