-
Notifications
You must be signed in to change notification settings - Fork 176
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
Error if same named type importable #8927
base: main
Are you sure you want to change the base?
Error if same named type importable #8927
Conversation
Changed 'name' to match others - "duplicate-import-type". Corrected the error code - "C4764". Moved the register function to the end of the file with all of the other ones.
close added to reset when moving to the next file to ensure no false errors
Changes made so that the duplicates throw an error if they are in the same folder and not in an IF or other condition statement
@l0lawrence can you review/route? |
/azp run tools - azure-pylint-guidelines-checker - ci |
Pull request contains merge conflicts. |
tools/pylint-extensions/azure-pylint-guidelines-checker/pylint_guidelines_checker.py
Outdated
Show resolved
Hide resolved
tools/pylint-extensions/azure-pylint-guidelines-checker/pylint_guidelines_checker.py
Outdated
Show resolved
Hide resolved
tools/pylint-extensions/azure-pylint-guidelines-checker/pylint_guidelines_checker.py
Outdated
Show resolved
Hide resolved
Merge azure-sdk-tools main into main
# Conflicts: # tools/pylint-extensions/azure-pylint-guidelines-checker/pylint_guidelines_checker.py # tools/pylint-extensions/azure-pylint-guidelines-checker/tests/test_pylint_custom_plugins.py
Spaces in the syntax removed and a test for special cases added
@microsoft-github-policy-service agree |
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.
Great tests! Just a few comments :)
tools/pylint-extensions/azure-pylint-guidelines-checker/tests/test_pylint_custom_plugins.py
Outdated
Show resolved
Hide resolved
tools/pylint-extensions/azure-pylint-guidelines-checker/pylint_guidelines_checker.py
Outdated
Show resolved
Hide resolved
@@ -2902,10 +2957,12 @@ def register(linter): | |||
linter.register_checker(DeleteOperationReturnStatement(linter)) | |||
linter.register_checker(ClientMethodsHaveTracingDecorators(linter)) | |||
linter.register_checker(DoNotImportLegacySix(linter)) | |||
linter.register_checker(DoNotImportAsyncio(linter)) |
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.
nit this got deleted :)
msgs = { | ||
"C4764": ( | ||
"Type %s is imported multiple times from the same module: %s", | ||
"duplicate-import-type", |
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.
can we align this with the name
above and make that also duplicate-import-type
Throws an error when there is a duplicate import in the same file.