[x] The logic in codegen that produces the method signatures is improved:
It produces type annotations without quotes.
The annotation is wrapped in Optional[..] if needed.
It takes the optional keyword in idl into account.
It no longer has None as a default value in cases where it should not.
It also generates type hints for methods that do not only consist of a descriptor.
[x] Can enable one lint rule that we disabled earlier.
TBH this was the reason I started this. Thought it was a quick fix, but ended up improving codegen for consistency with IDL quite a bit :)
[x] Apply check_struct() in a few more places, because the above fixes made the checker detect more cases.
[x] Enable making some args optional, even though IDL says they're not.
In practice this means that this PR does not introduce any backwards incompatible changes.
The cases where we apply this, include e.g. the depth_stencil arg in create_render_pipeline(). It's odd that IDL makes that field mandatory, because it means one cannot create a render pipeline without a depth-stencil attachment? We will have to look into this deeper when we implement the JS backend. It could well be an oversight in the IDL.
codegen
that produces the method signatures is improved:Optional[..]
if needed.optional
keyword in idl into account.None
as a default value in cases where it should not.check_struct()
in a few more places, because the above fixes made the checker detect more cases.depth_stencil
arg increate_render_pipeline()
. It's odd that IDL makes that field mandatory, because it means one cannot create a render pipeline without a depth-stencil attachment? We will have to look into this deeper when we implement the JS backend. It could well be an oversight in the IDL.