Re: [PATCH v5 1/4] dt-bindings: add DTS style checker
Krzysztof Kozlowski <[email protected]>
| Newsgroups | gmane.linux.drivers.devicetree,gmane.linux.kernel,gmane.linux.kbuild.devel |
|---|---|
| Message-ID | <20260609-rebel-hummingbird-of-maturity-2325b1@quoll> |
On Wed, May 27, 2026 at 08:32:10PM +0100, Daniel Golle wrote: > Add a Python tool that checks DTS coding style on examples in YAML > binding files and on .dts/.dtsi/.dtso source files. Rules are kept in > a small declarative registry, each tagged 'relaxed' (default; must be > zero-violation on the current tree) or 'strict' (opt-in for new > submissions). Promoting a rule from strict to relaxed is a one-line > edit once the tree is clean. > > Relaxed mode covers trailing whitespace, tab characters in YAML > examples, mixed tab+space indents, and missing tabs in .dts files. > Strict adds indent unit and consistency checks, blank-line placement, > sibling address ordering, "compatible" and "reg" ordering, and unused > labels. > > The tool reads file paths from @argfile and parallelises across CPUs > via -j N. With no -j given it picks up $PARALLELISM (set by > scripts/jobserver-exec from the GNU make jobserver) and falls back to > os.cpu_count() otherwise. Running as one Python invocation amortises > the ruamel.yaml import across the whole tree -- ~2s on a 32-CPU host > vs ~28s sequential. > > Signed-off-by: Daniel Golle <[email protected]> > --- Probably by relying mostly on regex instead of proper token parsing we will hit a wall at some point, but it's better than what I would write. Reviewed-by: Krzysztof Kozlowski <[email protected]> Best regards, Krzysztof