Closed arp242 closed 4 weeks ago
If we were to do this we should probably reorder the columns so that long type names don't completely ruin the layout. At the same time, I'm not a fan of putting the type last.
I don't think that padding should be indented, either. That suggests that it belongs to the preceding field when really it's for the next field, or in the case of trailing padding, for the first field.
I'll have to think about this.
Do note that you can achieve pretty similar output right now by piping through column -t -R3,5
I put the two-space indent on the padding to make it stand out more; because padding is usually what you're interested in. I found this pretty helpful when using it. Alternatively, could align with the type maybe.
I'm not too fussed about the details like column order or indenting the padding; let me know if you want to change anything specific. Or just feel free to close it if you don't like the change; I got my version that works well for me and that's all I really wanted. This small patch is very easy to maintain out-of-tree because structcheck rarely sees changes. That said, personally I do think it's useful for others too, otherwise I wouldn't have sent a patch, but tastes about this sort of thing differs. So don't worry too much about it.
I'll stick with the current output format for the sake of simplicity. Thanks!
This aligns the output of structlayout. To my eyes at least, this is a lot more readable, including more readable than the structlayout-pretty output.
Before:
And after: