Thread (19 messages) 19 messages, 6 authors, 5d ago

Re: [PATCH 3/7] cpufreq: rcpufreq_dt: use vertical import style

From: Guru Das Srinagesh <hidden>
Date: 2026-07-05 01:02:06
Also in: dri-devel, driver-core, linux-block, linux-pm, linux-pwm, linux-riscv, lkml, nova-gpu, rust-for-linux

On Tue, Jun 30, 2026 at 10:35:00AM +0200, Miguel Ojeda wrote:
On Mon, Jun 29, 2026 at 2:43 PM Zhongqiu Han
[off-list ref] wrote:
quoted
If the preferred style is to place each imported item on its own line,
shouldn't imports such as

     cpu, cpufreq,

be formatted similarly as well?
Indeed, good eyes.

To do what we want, `rustfmt` needs the `//` at the end of that level
too (in the future, it will be without the `//`), i.e. the patch
probably passes `rustfmtcheck`, but it still needs to split that line
and add the other `//`.
Hi Zhongqiu, Miguel:

Yes, I did run `make LLVM=1 rustfmtcheck` and it passed on this series. I will fix
the missed ones in v2.

While investigating this, I found that that adding this config `imports_layout =
"Vertical"` to the rustfmt options would fix all the imports automatically, including
the ones I missed. I ran it locally on the files touched in this series using rustfmt
nightly and it correctly fixed the imports as desired:

    rustup run nightly rustfmt --unstable-features \
      --config "imports_layout=Vertical" \
      --config-path .rustfmt.toml <file>

But unfortunately, since `imports_layout` is an unstable option currently [1], it
cannot be used straightaway.

However, .rustfmt.toml already has a section of commented-out unstable options kept
as a reference for when they stabilize. Would it make sense to add `#imports_layout =
"Vertical"` there? If so, I can include it in v2.

[1]: https://github.com/rust-lang/rustfmt/issues/3361
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help