flake8
-
djblets/siteconfig/forms.py (Diff revision 1) Show all issues -
djblets/siteconfig/models.py (Diff revision 1) 'typing.Any' imported but unused Column: 1 Error code: F401
Review Request #12702 — Created Oct. 28, 2022 and submitted
Information | |
---|---|
chipx86 | |
Djblets | |
release-3.x | |
Reviewers | |
djblets | |
djblets.siteconfig
, andSiteConfiguration
in particular, is central
to much of the Djblets and Review Board codebases. This change
inrtoduces type annotations to most of the module, helping to make sure
call sites are passing in all the right information.Settings management in
SiteConfiguration
is all typed now, helping
callers ensure they're handling results correctly.Mappings between siteconfig and Django settings are typed with
structuredTypeDict
s, so we can avoid any issues with invalid keys or
values in those sometimes-complex mappings.This was fairly smooth, though it did uncover a couple code paths where
assumptions were incorrectly made. Unbound varibable issues were fixed
in the management commands
All unit tests pass for all supported versions of Python.
Mypy and pyright were largely happy. There's some work in related modules
that still need to be done.
Summary | |
---|---|
Description | From | Last Updated |
---|---|---|
'djblets.siteconfig.models.SiteConfigurationSettings' imported but unused Column: 1 Error code: F401 |
![]() |
|
'typing.Any' imported but unused Column: 1 Error code: F401 |
![]() |
|
Typo (I think?) "Djangos" -> "Django" |
![]() |
|
Would it be worth it to include the type here like value: SiteConfigurationSettingsValue = siteconfig.get(key)? |
![]() |
|
Typo: "are" -> "that are" |
![]() |
|
Forgot to add str type. |
![]() |
|
Could add unused here. |
![]() |
|
Should add doc comments for these. |
![]() |
|
Forgot to add str type. |
![]() |
|
*args should come after clear_caches. Also will need to add *args to the doc string. |
![]() |
djblets/siteconfig/forms.py (Diff revision 1) |
---|
djblets/siteconfig/models.py (Diff revision 1) |
---|
'typing.Any' imported but unused Column: 1 Error code: F401
Removed unused imports.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+592 -194) |
djblets/siteconfig/django_settings.py (Diff revision 2) |
---|
Would it be worth it to include the type here like
value: SiteConfigurationSettingsValue = siteconfig.get(key)
?
djblets/siteconfig/models.py (Diff revision 2) |
---|
*args
should come afterclear_caches
. Also will need to add*args
to the doc string.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+612 -196) |