Re: [PATCH V6 2/2] checkpatch: check format of Vec<String> in modules

From: Guilherme Giacomo Simoes
Date: Wed Mar 05 2025 - 20:59:24 EST


Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> No, Andreas means a script written in Rust, rather than a binary that
> comes from the toolchain.
>
> I think it could be a good idea (it would be lovely to write the
> checker in Rust -- I also had a checker bot in Python from the old
> days of the old `rust` branch in GitHub), but `checkpatch.pl` doesn't
> need a built kernel, so it would be a disadvantage or at least a
> difference w.r.t. the usual `checkpatch.pl`, and we may not be able to
> call it from `checkpatch.pl`.
I don't know if I really understand how this would is do.

> Did you check? i.e. is it something we noticed, or something that
> generally happens but maybe not in this case? Is there a way to
> workaround or disable that (e.g. a `rustfmt` config value)?
The rustfmt have a array_width parameter [1], but with this, all arrays in rust
code will have the formatting that we set. (In this case, is 1 per line).

If we set the max_width, for limit the width of line, it seens for me, that
arrays don't are affected.

[1] https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#array_width

Thanks,
Guilherme