On Thu, Aug 1, 2019 at 7:45 PM Frank Rowand <frowand.list@xxxxxxxxx> wrote: > > Hi Paul, > > On 7/31/19 7:46 AM, Paul Spooren wrote: > > Hi, > > > > I hope this mail reaches the correct people! > > > > At OpenWrt[0] there are sometimes badly styled .dts files which waste > > human time to comment and fix, it would be nice to have some automatic > > checks for that. Is there a tool like astyle or clang-format for device > > tree files? > The bindings documents are being converted into a json-schema vocabulary. > Once in this format, the bindings to be used to validate .dts files. > See section "##Testing" in the file Documentation/devicetree/writing-schema.md > which is in the Linux kernel source tree for information on the validation > tools. > > Also, dtc has been adding many checks. See file checks.c in the dtc source > tree. Yes, but none of those concern formatting of dts files (e.g. 8 character tabs, {} locations, spaces around '='). I think the dtc checks code is too late in the flow to check those things, but maybe it is possible now with the source annotations recently added now that I think about it? My original thought was adding something at the earlier stages with the bison/flex parsing (of which I really have no experience with). Rob