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

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

Issue 2663623003: Simplify the initialization of Git objects in Host. (Closed)
Patch Set: Remove second paragraph in comment about awesome windows git hack 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()
129 128
130 stderr = self._engage_awesome_stderr_hacks() 129 stderr = self._engage_awesome_stderr_hacks()
131 130
132 # Checking for the verbose flag before calling check_webkit_style_parser () 131 # Checking for the verbose flag before calling check_webkit_style_parser ()
133 # lets us enable verbose logging earlier. 132 # lets us enable verbose logging earlier.
134 is_verbose = "-v" in args or "--verbose" in args 133 is_verbose = "-v" in args or "--verbose" in args
135 134
136 checker.configure_logging(stream=stderr, is_verbose=is_verbose) 135 checker.configure_logging(stream=stderr, is_verbose=is_verbose)
137 _log.debug("Verbose logging enabled.") 136 _log.debug("Verbose logging enabled.")
138 137
(...skipping 15 matching lines...) Expand all
154 patch_checker = PatchReader(file_reader) 153 patch_checker = PatchReader(file_reader)
155 patch_checker.check(patch) 154 patch_checker.check(patch)
156 155
157 error_count = style_processor.error_count 156 error_count = style_processor.error_count
158 file_count = file_reader.file_count 157 file_count = file_reader.file_count
159 delete_only_file_count = file_reader.delete_only_file_count 158 delete_only_file_count = file_reader.delete_only_file_count
160 159
161 _log.info("Total errors found: %d in %d files", error_count, file_count) 160 _log.info("Total errors found: %d in %d files", error_count, file_count)
162 # We fail when style errors are found or there are no checked files. 161 # We fail when style errors are found or there are no checked files.
163 return error_count > 0 or (file_count == 0 and delete_only_file_count == 0) 162 return error_count > 0 or (file_count == 0 and delete_only_file_count == 0)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698