Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Bump Pylint to 2.17 and flake8 to 6.0 #359
Changes from 21 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
There are no files selected for viewing
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.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 am actually curious how
(keep short; underscores are discouraged)
works.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 hint is shown in the
invalid-name
error message. For example:demo/demo.py:19:0: C0103: Class name "aa" doesn't conform to '{invalid-classname-hint}' pattern ('[_]{0,2}[A-Z]{1}[A-Za-z0-9]{0,30}$' pattern) (invalid-name)
I've removed all xxx-hint settings. See Azure/azure-cli#26685 (comment) and #359 (comment)
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 the name change?
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 this is a incompatibility introduced by pylint 2.14
Ref: pylint-dev/pylint#6931
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 saw the document has been moved to https://pylint.pycqa.org/en/v2.17.4/user_guide/messages/convention/invalid-name.html#predefined-naming-styles
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.
After further investigation, these naming-style config can be removed.
invalid-name
rule is disabled, these configurations make no sense.cli_pylintrc
hardly take effect as CLI has its ownpylintrc
.I've removed them in CLI.
Azure/azure-cli#26685 (comment)
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.
Otherwise it raises
azdev/operations/help/refdoc/common/directives.py:46:0: R0022: Useless option value for 'disable', 'no-self-use' was moved to an optional extension, see https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers. (useless-option-value)
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.
Pylint apparently doesn't think
no-self-use
is important anymore: pylint-dev/pylint#5502There 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 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 comment
The reason will be displayed to describe this comment to others. Learn more.
names
should beTuple[unicode, ...]
.https://github.com/sphinx-doc/sphinx/blob/645044d7f03c7fcb4c39a8edf40aa66f6d6c2b64/sphinx/util/docfields.py#L55-L57
Why is this type error never found?
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 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