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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/style/main.py

Issue 2671583002: Revert of Simplify the initialization of Git objects in Host. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) 1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 1. Redistributions of source code must retain the above copyright 6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright 8 # 2. Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the 9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution. 10 # documentation and/or other materials provided with the distribution.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 # the global sys.stderr. This involves updating the code to 118 # the global sys.stderr. This involves updating the code to
119 # accept a stream parameter where necessary, and not calling 119 # accept a stream parameter where necessary, and not calling
120 # sys.stderr explicitly anywhere. 120 # sys.stderr explicitly anywhere.
121 sys.stderr = stderr 121 sys.stderr = stderr
122 return stderr 122 return stderr
123 123
124 def main(self): 124 def main(self):
125 args = sys.argv[1:] 125 args = sys.argv[1:]
126 126
127 host = Host() 127 host = Host()
128 host.initialize_scm()
128 129
129 stderr = self._engage_awesome_stderr_hacks() 130 stderr = self._engage_awesome_stderr_hacks()
130 131
131 # Checking for the verbose flag before calling check_webkit_style_parser () 132 # Checking for the verbose flag before calling check_webkit_style_parser ()
132 # lets us enable verbose logging earlier. 133 # lets us enable verbose logging earlier.
133 is_verbose = "-v" in args or "--verbose" in args 134 is_verbose = "-v" in args or "--verbose" in args
134 135
135 checker.configure_logging(stream=stderr, is_verbose=is_verbose) 136 checker.configure_logging(stream=stderr, is_verbose=is_verbose)
136 _log.debug("Verbose logging enabled.") 137 _log.debug("Verbose logging enabled.")
137 138
(...skipping 15 matching lines...) Expand all
153 patch_checker = PatchReader(file_reader) 154 patch_checker = PatchReader(file_reader)
154 patch_checker.check(patch) 155 patch_checker.check(patch)
155 156
156 error_count = style_processor.error_count 157 error_count = style_processor.error_count
157 file_count = file_reader.file_count 158 file_count = file_reader.file_count
158 delete_only_file_count = file_reader.delete_only_file_count 159 delete_only_file_count = file_reader.delete_only_file_count
159 160
160 _log.info("Total errors found: %d in %d files", error_count, file_count) 161 _log.info("Total errors found: %d in %d files", error_count, file_count)
161 # We fail when style errors are found or there are no checked files. 162 # We fail when style errors are found or there are no checked files.
162 return error_count > 0 or (file_count == 0 and delete_only_file_count == 0) 163 return error_count > 0 or (file_count == 0 and delete_only_file_count == 0)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698