Commit 336a6271 authored by nbarth@chromium.org's avatar nbarth@chromium.org

Fix a few typos in checkdeps

R=Jói

Review URL: https://codereview.chromium.org/244313005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266477 0039d316-1c4b-4281-b951-d872f2087c98
parent 3e42ad4c
This diff is collapsed.
......@@ -33,7 +33,7 @@ def _IsTestFile(filename):
class DepsChecker(DepsBuilder):
"""Parses include_rules from DEPS files and erifies files in the
"""Parses include_rules from DEPS files and verifies files in the
source tree against them.
"""
......@@ -83,7 +83,7 @@ class DepsChecker(DepsBuilder):
def _CheckDirectoryImpl(self, checkers, dir_name):
rules = self.GetDirectoryRules(dir_name)
if rules == None:
if rules is None:
return
# Collect a list of all files and directories to check.
......@@ -125,18 +125,21 @@ class DepsChecker(DepsBuilder):
problems = []
for file_path, include_lines in added_includes:
if not cpp.IsCppFile(file_path):
pass
continue
rules_for_file = self.GetDirectoryRules(os.path.dirname(file_path))
if rules_for_file:
for line in include_lines:
is_include, violation = cpp.CheckLine(
rules_for_file, line, file_path, True)
if violation:
rule_type = violation.violated_rule.allow
if rule_type != Rule.ALLOW:
violation_text = results.NormalResultsFormatter.FormatViolation(
violation, self.verbose)
problems.append((file_path, rule_type, violation_text))
if not rules_for_file:
continue
for line in include_lines:
is_include, violation = cpp.CheckLine(
rules_for_file, line, file_path, True)
if not violation:
continue
rule_type = violation.violated_rule.allow
if rule_type == Rule.ALLOW:
continue
violation_text = results.NormalResultsFormatter.FormatViolation(
violation, self.verbose)
problems.append((file_path, rule_type, violation_text))
return problems
......
......@@ -62,7 +62,7 @@ class CppChecker(object):
# Don't fail when no directory is specified. We may want to be more
# strict about this in the future.
if self._verbose:
print ' WARNING: directory specified with no path: ' + include_path
print ' WARNING: include specified with no directory: ' + include_path
return True, None
rule = rules.RuleApplyingTo(include_path, dependee_path)
......@@ -86,7 +86,7 @@ class CppChecker(object):
line = line.strip()
# Check to see if we're at / inside a #if 0 block
# Check to see if we're at / inside an #if 0 block
if line.startswith('#if 0'):
in_if0 += 1
continue
......
......@@ -35,7 +35,7 @@ class Rule(object):
which is fully self-sufficient to answer the question whether the dependent
is allowed to depend on the dependee, without knowing the external
context."""
return (self.allow, self._dependent_dir or '.', self._dir or '.')
return self.allow, self._dependent_dir or '.', self._dir or '.'
def ParentOrMatch(self, other):
"""Returns true if the input string is an exact match or is a parent
......@@ -74,7 +74,7 @@ def ParseRuleString(rule_string, source):
'The rule string "%s" does not begin with a "+", "-" or "!".' %
rule_string)
return (rule_string[0], rule_string[1:])
return rule_string[0], rule_string[1:]
class Rules(object):
......@@ -141,7 +141,7 @@ class Rules(object):
matches the expression. None to match all
dependee files.
"""
(rule_type, rule_dir) = ParseRuleString(rule_string, source)
rule_type, rule_dir = ParseRuleString(rule_string, source)
if not dependee_regexp:
rules_to_update = self._general_rules
......
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