-
Notifications
You must be signed in to change notification settings - Fork 183
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
Don't log errors that we end up raising #22557 #8819
Don't log errors that we end up raising #22557 #8819
Conversation
Added new rule for this issue to the pylint_guidelines_checker file. Added corresponding tests to the test_pylint_custom_plugins file
Added two more tests to check for multiple exception blocks
Changed 'warning' to '.warning' etc. Help avoid any false positives e.g. 'print("error")' will now not trigger Pylint
Merge branch 'main' into dont-log-errors-end-up-raising
Also added another test to test_pylint_custom_plugins.py for 'warning' level.
@microsoft-github-policy-service agree |
tools/pylint-extensions/azure-pylint-guidelines-checker/README.md
Outdated
Show resolved
Hide resolved
tools/pylint-extensions/azure-pylint-guidelines-checker/tests/test_pylint_custom_plugins.py
Outdated
Show resolved
Hide resolved
Also rename checker to "do-not-log-raised-errors"
Added '.lower()' to string being parsed for logging.
/azp run tools - azure-pylint-guidelines-checker - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Looking good - I think we're nearly there.
Do you have a sample output for SDKs in the repo that get flagged by this new rule?
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
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
tools/pylint-extensions/azure-pylint-guidelines-checker/tests/test_pylint_custom_plugins.py
Show resolved
Hide resolved
…_guidelines_checker.py Co-authored-by: Anna Tisch <antisch@microsoft.com>
Also added relevant tests
The output of the Pylint testing against the SDKs is below. This was before the changes I have just made. Will run tests again later :). All of them are true positives. |
Refactored function and removed 'isInstance Astroid.For' and associated tests
Output from re-testing against the SDKs after changes made yesterday. Looks good, all true positives :) |
Addresses Azure/azure-sdk-for-python#22557
Checks that errors raised in exception blocks aren't also logged at '
warning
' and 'error
' levels.