Re: [PATCH v2 4/7] scripts: generate_rust_analyzer.py: add type hints
From: Tamir Duberstein
Date: Sat Mar 15 2025 - 08:21:02 EST
On Tue, Mar 11, 2025 at 9:17 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> Python type hints allow static analysis tools like mypy to detect type
> errors during development, improving the developer experience.
>
> Python type hints have been present in the kernel since 2019 at the
> latest; see commit 6ebf5866f2e8 ("kunit: tool: add Python wrappers for
> running KUnit tests").
>
> Run `uv tool run mypy --strict scripts/generate_rust_analyzer.py` to
> verify.
>
> This removes `"is_proc_macro": false` from `rust-project.json` in
> exchange for stricter types. This field is interpreted as false if
> absent[1] so this doesn't change the behavior of rust-analyzer.
>
> Link: https://github.com/rust-lang/rust-analyzer/blob/8d01570b5e812a49daa1f08404269f6ea5dd73a1/crates/project-model/src/project_json.rs#L372-L373 [1]
> Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
Gentle ping. Please have a look if you aren't intimidated by python
type hints :)