Diff
Modified: trunk/Tools/ChangeLog (97503 => 97504)
--- trunk/Tools/ChangeLog 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/ChangeLog 2011-10-14 21:12:49 UTC (rev 97504)
@@ -1,3 +1,18 @@
+2011-10-14 Dimitri Glazkov <[email protected]>
+
+ Plumb style-checker filter up to command options and make land-cowboy use it.
+ https://bugs.webkit.org/show_bug.cgi?id=70119
+
+ Reviewed by Adam Barth.
+
+ * Scripts/webkitpy/style/checker.py: Added ChangeLogChecker categories to the big list.
+ * Scripts/webkitpy/style/checkers/changelog.py: Declared categories, used in ChangeLogChecker.
+ * Scripts/webkitpy/tool/commands/download.py: Made LandCowboy use filter.
+ * Scripts/webkitpy/tool/commands/download_unittest.py: Tweaked the test.
+ * Scripts/webkitpy/tool/commands/upload_unittest.py: Ditto.
+ * Scripts/webkitpy/tool/steps/checkstyle.py: Made check_style_filter work.
+ * Scripts/webkitpy/tool/steps/options.py: Added new option, check-style-filter.
+
2011-10-14 Sam Weinig <[email protected]>
Remove the Leopard slaves.
Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/style/checker.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -311,6 +311,7 @@
# Take the union across all checkers.
categories = CommonCategories.union(CppChecker.categories)
categories = categories.union(TestExpectationsChecker.categories)
+ categories = categories.union(ChangeLogChecker.categories)
# FIXME: Consider adding all of the pep8 categories. Since they
# are not too meaningful for documentation purposes, for
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/changelog.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/style/checkers/changelog.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/changelog.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -31,9 +31,10 @@
class ChangeLogChecker(object):
-
"""Processes text lines for checking style."""
+ categories = set(['changelog/bugnumber', 'changelog/filechangedescriptionwhitespace'])
+
def __init__(self, file_path, handle_style_error, should_line_be_checked):
self.file_path = file_path
self.handle_style_error = handle_style_error
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/tool/commands/download.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -126,7 +126,10 @@
steps.CloseBugForLandDiff,
]
+ def _prepare_state(self, options, args, tool):
+ options.check_style_filter = "-changelog"
+
class AbstractPatchProcessingCommand(AbstractDeclarativeCommand):
# Subclasses must implement the methods below. We don't declare them here
# because we want to be able to implement them with mix-ins.
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -72,6 +72,7 @@
options.build = True
options.build_style = True
options.check_style = True
+ options.check_style_filter = None
options.clean = True
options.close_bug = True
options.force_clean = False
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -60,6 +60,7 @@
options = MockOptions()
options.cc = None
options.check_style = True
+ options.check_style_filter = None
options.comment = None
options.description = "MOCK description"
options.request_commit = False
@@ -108,6 +109,7 @@
options = MockOptions()
options.cc = None
options.check_style = True
+ options.check_style_filter = None
options.comment = None
options.description = "MOCK description"
options.request_commit = False
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/checkstyle.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/tool/steps/checkstyle.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/checkstyle.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -39,6 +39,7 @@
return AbstractStep.options() + [
Options.non_interactive,
Options.check_style,
+ Options.check_style_filter,
Options.git_commit,
]
@@ -54,6 +55,10 @@
args.append("--diff-files")
args.extend(self._changed_files(state))
+ if self._options.check_style_filter:
+ args.append("--filter")
+ args.extend(self._options.check_style_filter)
+
try:
self._tool.executive.run_and_throw_if_fail(self._tool.port().check_webkit_style_command() + args, cwd=self._tool.scm().checkout_root)
except ScriptError, e:
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/options.py (97503 => 97504)
--- trunk/Tools/Scripts/webkitpy/tool/steps/options.py 2011-10-14 20:58:08 UTC (rev 97503)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/options.py 2011-10-14 21:12:49 UTC (rev 97504)
@@ -35,6 +35,7 @@
cc = make_option("--cc", action="" type="string", dest="cc", help="Comma-separated list of email addresses to carbon-copy.")
check_builders = make_option("--ignore-builders", action="" dest="check_builders", default=True, help="DEPRECATED: Will be removed any time after 11/01/11.")
check_style = make_option("--ignore-style", action="" dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
+ check_style_filter = make_option("--check-style-filter", action="" type="string", dest="check_style_filter", default=None, help="Filter style-checker rules (see check-webkit-style --help).")
clean = make_option("--no-clean", action="" dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
close_bug = make_option("--no-close", action="" dest="close_bug", default=True, help="Leave bug open after landing.")
comment = make_option("--comment", action="" type="string", dest="comment", help="Comment to post to bug.")