Commit 928b93aa authored by dglazkov@chromium.org's avatar dglazkov@chromium.org
Browse files

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 80c4ad52
2011-10-14 Dimitri Glazkov <dglazkov@chromium.org>
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 <sam@webkit.org>
 
Remove the Leopard slaves.
......@@ -311,6 +311,7 @@ def _all_categories():
# 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
......
......@@ -31,9 +31,10 @@ from webkitpy.common.checkout.changelog import parse_bug_id_from_changelog
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
......
......@@ -126,6 +126,9 @@ class LandCowboy(AbstractSequencedCommand):
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
......
......@@ -72,6 +72,7 @@ class DownloadCommandsTest(CommandsTest):
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
......
......@@ -60,6 +60,7 @@ Bug 50002 has no non-obsolete patches, ignoring.
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 @@ extra comment
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
......
......@@ -39,6 +39,7 @@ class CheckStyle(AbstractStep):
return AbstractStep.options() + [
Options.non_interactive,
Options.check_style,
Options.check_style_filter,
Options.git_commit,
]
......@@ -54,6 +55,10 @@ class CheckStyle(AbstractStep):
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:
......
......@@ -35,6 +35,7 @@ class Options(object):
cc = make_option("--cc", action="store", type="string", dest="cc", help="Comma-separated list of email addresses to carbon-copy.")
check_builders = make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="DEPRECATED: Will be removed any time after 11/01/11.")
check_style = make_option("--ignore-style", action="store_false", 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="store", type="string", dest="check_style_filter", default=None, help="Filter style-checker rules (see check-webkit-style --help).")
clean = make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
close_bug = make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing.")
comment = make_option("--comment", action="store", type="string", dest="comment", help="Comment to post to bug.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment