-
Notifications
You must be signed in to change notification settings - Fork 18
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
added flake8-type-checking #513
Conversation
(MyPy is failing for reasons probably unrelated to this PR) |
FYI: MyPy update has broken the test on master test@master: https://github.com/cylc/cylc-uiserver/actions/runs/6547017705 |
cylc/uiserver/handlers.py
Outdated
@@ -97,7 +98,7 @@ def is_token_authenticated(handler: 'CylcAppHandler') -> bool: | |||
In these cases the bearer of the token is awarded full privileges. | |||
""" | |||
identity_provider: JPSIdentityProvider = ( | |||
handler.serverapp.identity_provider | |||
handler.serverapp.identity_provider # type: ignore |
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.
It is better to be specific about which error we are ignoring, so that other valid errors can still be flagged. The error code is displayed in square brackets at the end of the message:
Item "None" of "Optional[ServerApp]" has no attribute "identity_provider" [union-attr]
handler.serverapp.identity_provider # type: ignore | |
handler.serverapp.identity_provider # type: ignore[union-attr] |
|
||
# Suppress the following messages: | ||
# By default the bodies of untyped functions are not checked, consider using --check-untyped-defs | ||
disable_error_code = annotation-unchecked |
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 is not strictly needed as those messages are informational and don't fail the check)
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #513 +/- ##
==========================================
- Coverage 75.42% 75.38% -0.04%
==========================================
Files 12 12
Lines 1428 1426 -2
Branches 236 236
==========================================
- Hits 1077 1075 -2
Misses 301 301
Partials 50 50
☔ View full report in Codecov by Sentry. |
Closes cylc/cylc-admin#182
Added flake8-type-checking library to project and resolved issues it identified.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.