-
Notifications
You must be signed in to change notification settings - Fork 115
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
Bump Pylint to 2.17 and flake8 to 6.0 #359
Changes from all 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 |
---|---|---|
|
@@ -25,7 +25,10 @@ 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, | ||
missing-timeout | ||
|
||
[FORMAT] | ||
max-line-length=120 | ||
|
@@ -42,21 +45,3 @@ max-branches=20 | |
|
||
[SIMILARITIES] | ||
min-similarity-lines=10 | ||
|
||
[BASIC] | ||
# Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). | ||
# Consider these guidelines and not hard rules. Read PEP 8 for more details. | ||
|
||
# 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) | ||
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 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) |
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 | ||||||
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 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',)), | ||||||
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. 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? 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.
Any reason for reformatting?
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 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.
Use this to prevent
ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'
Related issue: PyCQA/flake8#1750 Azure/azure-cli#25370
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.
When
pylint==2.11.1
, it installsmccabe
0.6.1.flake8
also requiresmccabe
, and only 4.0.1 meet the version constraint.After upgrading PyLint 2.7,
mccabe
becomes [required: >=0.6,<0.8, installed: 0.7.0], and flake8 becomes 6.0.0.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.
Does this issue still exist in pylint 2.17.4? https://pypi.org/project/pylint/
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.
When run
azdev style
, it usespylintrc
and.flake8
in CLI/Extension repo folder. If the files do not exist, it usecli.xxxx
orext.xxx
inazdev config
folder.CLI's
.flake8
is updated in Azure/azure-cli#25370.