Modernize and update the API capabilities object.
Review Request #12608 — Created Sept. 19, 2022 and submitted
Information | |
---|---|
david | |
RBTools | |
release-4.x | |
Reviewers | |
rbtools | |
This small change updates the API capabilities object with modern docs
and type annotations.
Ran unit tests.
Summary | |
---|---|
Description | From | Last Updated |
---|---|---|
We should use Dict[str, object] for this, to be a bit more explicit. |
|
|
I know it was this way before, but we probably don't need to capitalize capabilities. |
|
|
Missing a trailing period. |
|
|
This won't permit nested dictionaries or bools. It only allows a flat dictionary of string keys and values. Recursive dicts … |
|
|
Missing trailing comma. |
|
|
'typing.Union' imported but unused Column: 1 Error code: F401 |
![]() |
-
-
rbtools/api/capabilities.py (Diff revision 1) We should use
Dict[str, object]
for this, to be a bit more explicit. -
rbtools/commands/__init__.py (Diff revision 1) I know it was this way before, but we probably don't need to capitalize capabilities.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+112 -32) |
Checks run (2 succeeded)
-
-
-
rbtools/api/capabilities.py (Diff revision 2) This won't permit nested dictionaries or bools. It only allows a flat dictionary of string keys and values.
Recursive dicts are a problem and our capabilities don't have a specific nesting level for values. So we have to be generic with
Dict[str, object]
.(
object
instead ofAny
, as the former ensures consistent type safety when reassigning values and the latter says "screw type safety."). -
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+112 -32) |
Checks run (1 failed, 1 succeeded)
flake8
-
rbtools/api/capabilities.py (Diff revision 3) 'typing.Union' imported but unused Column: 1 Error code: F401
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+112 -32) |