ref(incidents): Add type hints to sentry/incidents/logic.py
Add type hints to the sentry.incidents.logic module and some related functions.
Remove unused function parameters. Change default collection args from None to () where they are treated interchangeably, to minimize nullable arg types. Add explicit null checks where required by the type checker.
Add underscore prefix to functions used privately. Move functions that were used only by a single module.
Codecov Report
Attention: Patch coverage is 93.37748% with 10 lines in your changes missing coverage. Please review.
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## master #75541 +/- ##
==========================================
- Coverage 78.13% 78.13% -0.01%
==========================================
Files 6931 6931
Lines 307646 307695 +49
Branches 50358 50364 +6
==========================================
+ Hits 240386 240424 +38
- Misses 60864 60870 +6
- Partials 6396 6401 +5
this patch has gotten pretty large -- can we split out parts of those and land them separately to minimize risk and increase reviewability?
It got large because that's what was necessary to remove "sentry.incidents.logic" from pyproject.toml. You want me to put it back in?
this patch has gotten pretty large -- can we split out parts of those and land them separately to minimize risk and increase reviewability?
It got large because that's what was necessary to remove
"sentry.incidents.logic"frompyproject.toml. You want me to put it back in?
no. there are logical parts of this patch that can be landed separately which will reduce risk and improve reviewability
@asottile-sentry Functional changes broken out into:
- https://github.com/getsentry/sentry/pull/77197
- https://github.com/getsentry/sentry/pull/77199
- https://github.com/getsentry/sentry/pull/77200
- https://github.com/getsentry/sentry/pull/77201
@asottile-sentry Functional changes broken out into:
thank you! those are so much easier to review
@asottile-sentry Now the PR should consist only of type annotation fixes, with the only changes to flow being a few helper functions motivated by type-checking.