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