Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: tools/checkdeps/checkdeps.py

Issue 244313005: Fix a few typos and style in checkdeps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Python style fixes too Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/checkdeps/builddeps.py ('k') | tools/checkdeps/cpp_checker.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/checkdeps/checkdeps.py
diff --git a/tools/checkdeps/checkdeps.py b/tools/checkdeps/checkdeps.py
index 6e815c0e2cd81d5f3d6a73948dd3a224728d8ec7..5bf79076063b98d5293616292d4b9157b7044196 100755
--- a/tools/checkdeps/checkdeps.py
+++ b/tools/checkdeps/checkdeps.py
@@ -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
Nils Barth (inactive) 2014/04/21 08:36:09 This |pass| looks like a bug, as the |if| does not
Jói 2014/04/22 14:23:31 I think you're right.
Nils Barth (inactive) 2014/04/23 08:59:23 Thanks for checking!
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
« no previous file with comments | « tools/checkdeps/builddeps.py ('k') | tools/checkdeps/cpp_checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698