Commit e1cf0f63 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Rename "webkit" to "blink" in style check code.

As now we use blink instead of webkit, this CL rename
check_webkit_style* to check_blink_style*.

Change-Id: I340719a4c80cbc1dc4934fbdc4fa40b56347d8f8
Reviewed-on: https://chromium-review.googlesource.com/c/1482274Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Cr-Commit-Position: refs/heads/master@{#634561}
parent f8f12a8e
...@@ -226,22 +226,22 @@ def _all_categories(): ...@@ -226,22 +226,22 @@ def _all_categories():
return categories return categories
def _check_webkit_style_defaults(): def _check_blink_style_defaults():
"""Return the default command-line options for check_blink_style.py.""" """Return the default command-line options for check_blink_style.py."""
return DefaultCommandOptionValues(min_confidence=_DEFAULT_MIN_CONFIDENCE, return DefaultCommandOptionValues(min_confidence=_DEFAULT_MIN_CONFIDENCE,
output_format=_DEFAULT_OUTPUT_FORMAT) output_format=_DEFAULT_OUTPUT_FORMAT)
# This function assists in optparser not having to import from checker. # This function assists in optparser not having to import from checker.
def check_webkit_style_parser(): def check_blink_style_parser():
all_categories = _all_categories() all_categories = _all_categories()
default_options = _check_webkit_style_defaults() default_options = _check_blink_style_defaults()
return ArgumentParser(all_categories=all_categories, return ArgumentParser(all_categories=all_categories,
base_filter_rules=_BASE_FILTER_RULES, base_filter_rules=_BASE_FILTER_RULES,
default_options=default_options) default_options=default_options)
def check_webkit_style_configuration(options): def check_blink_style_configuration(options):
"""Return a StyleProcessorConfiguration instance for check_blink_style.py. """Return a StyleProcessorConfiguration instance for check_blink_style.py.
Args: Args:
......
...@@ -44,8 +44,8 @@ from blinkpy.style.checker import _all_categories ...@@ -44,8 +44,8 @@ from blinkpy.style.checker import _all_categories
from blinkpy.style.checker import _BASE_FILTER_RULES from blinkpy.style.checker import _BASE_FILTER_RULES
from blinkpy.style.checker import _MAX_REPORTS_PER_CATEGORY from blinkpy.style.checker import _MAX_REPORTS_PER_CATEGORY
from blinkpy.style.checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER from blinkpy.style.checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER
from blinkpy.style.checker import check_webkit_style_configuration from blinkpy.style.checker import check_blink_style_configuration
from blinkpy.style.checker import check_webkit_style_parser from blinkpy.style.checker import check_blink_style_parser
from blinkpy.style.checker import CheckerDispatcher from blinkpy.style.checker import CheckerDispatcher
from blinkpy.style.checker import configure_logging from blinkpy.style.checker import configure_logging
from blinkpy.style.checker import StyleProcessor from blinkpy.style.checker import StyleProcessor
...@@ -155,9 +155,11 @@ class GlobalVariablesTest(unittest.TestCase): ...@@ -155,9 +155,11 @@ class GlobalVariablesTest(unittest.TestCase):
return _all_categories() return _all_categories()
def defaults(self): def defaults(self):
return style._check_webkit_style_defaults() # Access to a protected member _check_blink_style_defaults
# pylint: disable=W0212
return style._check_blink_style_defaults()
def test_webkit_base_filter_rules(self): def test_blink_base_filter_rules(self):
base_filter_rules = _BASE_FILTER_RULES base_filter_rules = _BASE_FILTER_RULES
already_seen = [] already_seen = []
validate_filter_rules(base_filter_rules, self._all_categories()) validate_filter_rules(base_filter_rules, self._all_categories())
...@@ -224,18 +226,18 @@ class GlobalVariablesTest(unittest.TestCase): ...@@ -224,18 +226,18 @@ class GlobalVariablesTest(unittest.TestCase):
'Key "%s" is not a category' % category) 'Key "%s" is not a category' % category)
class CheckWebKitStyleFunctionTest(unittest.TestCase): class CheckBlinkStyleFunctionTest(unittest.TestCase):
"""Tests the functions with names of the form check_webkit_style_*.""" """Tests the functions with names of the form check_blink_style_*."""
def test_check_webkit_style_configuration(self): def test_check_blink_style_configuration(self):
# Exercise the code path to make sure the function does not error out. # Exercise the code path to make sure the function does not error out.
option_values = CommandOptionValues() option_values = CommandOptionValues()
check_webkit_style_configuration(option_values) check_blink_style_configuration(option_values)
def test_check_webkit_style_parser(self): def test_check_blink_style_parser(self):
# Exercise the code path to make sure the function does not error out. # Exercise the code path to make sure the function does not error out.
check_webkit_style_parser() check_blink_style_parser()
class CheckerDispatcherSkipTest(unittest.TestCase): class CheckerDispatcherSkipTest(unittest.TestCase):
......
...@@ -128,17 +128,17 @@ class CheckBlinkStyle(object): ...@@ -128,17 +128,17 @@ class CheckBlinkStyle(object):
stderr = self._engage_awesome_stderr_hacks() stderr = self._engage_awesome_stderr_hacks()
# Checking for the verbose flag before calling check_webkit_style_parser() # Checking for the verbose flag before calling check_blink_style_parser()
# lets us enable verbose logging earlier. # lets us enable verbose logging earlier.
is_verbose = '-v' in args or '--verbose' in args is_verbose = '-v' in args or '--verbose' in args
checker.configure_logging(stream=stderr, is_verbose=is_verbose) checker.configure_logging(stream=stderr, is_verbose=is_verbose)
_log.debug('Verbose logging enabled.') _log.debug('Verbose logging enabled.')
parser = checker.check_webkit_style_parser() parser = checker.check_blink_style_parser()
(paths, options) = parser.parse(args) (paths, options) = parser.parse(args)
configuration = checker.check_webkit_style_configuration(options) configuration = checker.check_blink_style_configuration(options)
paths = change_directory(host.filesystem, checkout_root=host.git().checkout_root, paths=paths) paths = change_directory(host.filesystem, checkout_root=host.git().checkout_root, paths=paths)
......
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