feature: "top-level-types required" mode for `.bzl` files
- Dominant language
- Rust
- Stars
- 4.4k
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
I'm working on my own Prelude and occasionally I do this thing where I splat out some function, then run it with the wrong arguments later in the file. This is a time-honored tradition for those working in Python-derived languages.
Buck2 Starlark already has MyPy-style types, but what I'd like is to make sure types always have to be provided for all top-level `.bzl` code in my repository. That is, every single `def` in a `.bzl` should have all arguments typed, and a return type. Note that I consider `typing.Any` to be accetable, BTW — but only because it's much easier to spot and audit, and because having *something* for gradual migration is occasionally necessary. (This is coincidentally considered to be good practice or mandatory in most languages with inferred types, anyway.)
Does this kind of feature make sense? I'm sure there's something I can't anticipate; I know the typing support has undergone a lot of work in the past year, so it would be great if this were possible.
I would also accept a `lint` for this, I suppose.
Contributor guide
Assessment
This issue has not been assessed yet.