NEW 31137
Adds a cursory check of the ChangeLog in svn-create-patch
https://bugs.webkit.org/show_bug.cgi?id=31137
Summary Adds a cursory check of the ChangeLog in svn-create-patch
Eric Ayers
Reported 2009-11-04 12:11:33 PST
I've submitted more than one patch where I fat fingered the ChangeLog file in one way or another. I've updated my editor settings now, but its tedious and time consuming for committers to throw out patches for these nits that the commit hooks catch. svn-create-patch may not be the ideal place to put these, as it won't be used by developers using git or svn directly, but the routine that does the checks is in the VCSUtils library and could be re-used.
Attachments
Adds some style checks of the ChangeLog file in svn-create-patch (2.45 KB, patch)
2009-11-04 12:19 PST, Eric Ayers
timothy: review-
Updates the tab test in changelog to match tabs anywhere, incorporates other review feedback. (2.64 KB, patch)
2009-11-04 13:57 PST, Eric Ayers
no flags
Eric Ayers
Comment 1 2009-11-04 12:19:05 PST
Created attachment 42508 [details] Adds some style checks of the ChangeLog file in svn-create-patch This came out of some discussion during the commit of bug 31121
Timothy Hatcher
Comment 2 2009-11-04 12:54:08 PST
Comment on attachment 42508 [details] Adds some style checks of the ChangeLog file in svn-create-patch > + if ($patch =~ /^\+\t/m) { > + push(@styleMessages, " - ChangeLog contains leading tab character."); No tabs are allowed, leading or otherwise. > + if (!($patch =~ /^\+.*https:\/\/bugs.webkit.org\//m)) { > + push(@styleMessages, " - No bug URL found in ChangeLog entry."); Another valid format is http://webkit.org/b/XXXXX. If we care. > + warn("* Problems found in ".$file.":\n" . join("\n", @styleMessages) . "\n"); Put spaces around the "."s or put $file directly in the string. r- for the tab check being restrictive.
Eric Ayers
Comment 3 2009-11-04 13:57:11 PST
Created attachment 42519 [details] Updates the tab test in changelog to match tabs anywhere, incorporates other review feedback.
Eric Ayers
Comment 4 2009-11-04 13:58:11 PST
(In reply to comment #2) > (From update of attachment 42508 [details]) > > > + if ($patch =~ /^\+\t/m) { > > + push(@styleMessages, " - ChangeLog contains leading tab character."); > > No tabs are allowed, leading or otherwise. Changed to spit out a warning on any tab char (after ignoring diff headers) > > > + if (!($patch =~ /^\+.*https:\/\/bugs.webkit.org\//m)) { > > + push(@styleMessages, " - No bug URL found in ChangeLog entry."); > > Another valid format is http://webkit.org/b/XXXXX. If we care. Done. > > + warn("* Problems found in ".$file.":\n" . join("\n", @styleMessages) . "\n"); > > Put spaces around the "."s or put $file directly in the string. Done. > r- for the tab check being restrictive.
Mark Rowe (bdash)
Comment 5 2009-11-04 19:29:59 PST
Why put this in svn-create-patch rather than check-webkit-style? The latter is explicitly about checking for these sorts of style issues. Doing it during patch creation is a little strange.
Eric Seidel (no email)
Comment 6 2009-11-04 19:53:55 PST
Mark is right. This makes more sense as part of check-webkit-style or similar. That said, It might make sense for svn-create-patch to automatically check the style (or at least accept a --check-style flag) by calling check-webkit-style.
Eric Ayers
Comment 7 2009-11-05 12:21:22 PST
My rationale for putting it in the patch creation is that at least one of these checks causes a review to be automatically thrown out by the commit hook on the server, and for my env, running svn-create-patch is mandatory and guaranteed to be done after the ChangeLog is updated. I will work this up to run under webkit-check-style. It would be nice if the svn-create-patch could feed the data to create-webkit-check without having to make the diff twice (takes a while on my box.)
Eric Ayers
Comment 8 2009-11-05 12:28:50 PST
(In reply to comment #7) >... It would be nice if the > svn-create-patch could feed the data to create-webkit-check without having to > make the diff twice (takes a while on my box.) I meant, feed the diff data from svn-create-patch to check-webkit-style.
Note You need to log in before you can comment on or make changes to this bug.