On Tue, Jul 25, 2017 at 6:37 AM, Peter Simons <psimons@suse.de> wrote:
Johannes Meixner writes:
...
Having said that, I am hugely in favor of enforcing a rule that all spec files must pass through spec-cleaner though, for the following reasons:
- All spec files will look basically the same. Attributes are specified in the same order and in the same spelling, which makes it easier to read them. It's also easier to "grep" for things if spelling is uniform. Having a reliable structure simplifies the task of scripting things in general, because stronger assumptions can be made.
If by spelling you mean case then most programming editors support case insensitive search. Reliable scripting should be based on the spec file syntax not formatting.
- When spec files are normalized before committing (like, ensuring that all BuildDepends are ordered alphabetically), then the resulting diffs will be minimal. There won't be any pointless white-space changes obscuring the purpose of the modification. Nor will there be changes that turn the spelling of "Url" into "URL" for no apparent reason. That makes life easier for people who review SRs etc.
A normalization tool should not be allowed to perform any kind of semantic changes. Only formatting. And even then - not anonymously.
- If every spec file is known to pass through spec-cleaner, then we can reliably re-run the tool on every spec file to perform mass style updates. A new version of spec-cleaner might, for example, re-write the copyright disclaimer, or it might replace an obsolete attribute with the newer version, or whatever. Once you know that all spec files can be passed through the tool without breaking them, you can use the tool for maintenance tasks that wouldn't be feasible otherwise.
Any maintenance tool could be reliable only if it is based on the spec file syntax and if it is stable (as in stable sort) to be easily reviewable. Best regards, Mikhail -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org