On 08/15/2012 02:23 PM, Kinkie wrote: > the attached (auto-generated, but tested) patch sorts all include > directives alphabetically for all .cc files in the source-tree. > The attached file generated the patch with the shell command: > for file in $(find . -name \*.cc); do sort-includes.pl $file >> $file.moved; mv $file.moved $file; done
> The specification for the sorting is: > sort any block of consecutive (no white lines or other directives) > #include "" directives alphabetrically, case-insensitively, leaving > squid.h as the first one. Please include the Perl script in the patch. It should be committed so that others can use it when modifying files. Ideally, it should be integrated with the automated source formatting scripts, of course. Please add a short #comment to the Perl script, to describe what it does. Please use "use strict" and "use warnings" in the Perl script. Consider adjusting the regex detecting an #include statement to handle "#\s+include" cases (with whitespace between # and include), but we seem to be using that syntax for system (and generated) files only for now, so this is optional. > The resulting tree passes the test-suite on my Kubuntu Precise. > If it's OK, I'll merge the patch and add the sort-includes.pl tool in scripts/ Please do not merge until the current build is fixed. Whatever method of testing you are using, it does not apparently catch basic build errors in common configurations, so we better take it one step at a time. Thank you, Alex.
