| OLD | NEW |
| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 is_verbose = "-v" in args or "--verbose" in args | 133 is_verbose = "-v" in args or "--verbose" in args |
| 134 | 134 |
| 135 checker.configure_logging(stream=stderr, is_verbose=is_verbose) | 135 checker.configure_logging(stream=stderr, is_verbose=is_verbose) |
| 136 _log.debug("Verbose logging enabled.") | 136 _log.debug("Verbose logging enabled.") |
| 137 | 137 |
| 138 parser = checker.check_webkit_style_parser() | 138 parser = checker.check_webkit_style_parser() |
| 139 (paths, options) = parser.parse(args) | 139 (paths, options) = parser.parse(args) |
| 140 | 140 |
| 141 configuration = checker.check_webkit_style_configuration(options) | 141 configuration = checker.check_webkit_style_configuration(options) |
| 142 | 142 |
| 143 paths = change_directory(host.filesystem, checkout_root=host.scm().check
out_root, paths=paths) | 143 paths = change_directory(host.filesystem, checkout_root=host.git().check
out_root, paths=paths) |
| 144 | 144 |
| 145 style_processor = StyleProcessor(configuration) | 145 style_processor = StyleProcessor(configuration) |
| 146 file_reader = TextFileReader(host.filesystem, style_processor) | 146 file_reader = TextFileReader(host.filesystem, style_processor) |
| 147 | 147 |
| 148 if paths and not options.diff_files: | 148 if paths and not options.diff_files: |
| 149 file_reader.process_paths(paths) | 149 file_reader.process_paths(paths) |
| 150 else: | 150 else: |
| 151 changed_files = paths if options.diff_files else None | 151 changed_files = paths if options.diff_files else None |
| 152 patch = host.scm().create_patch(options.git_commit, changed_files=ch
anged_files) | 152 patch = host.git().create_patch(options.git_commit, changed_files=ch
anged_files) |
| 153 patch_checker = PatchReader(file_reader) | 153 patch_checker = PatchReader(file_reader) |
| 154 patch_checker.check(patch) | 154 patch_checker.check(patch) |
| 155 | 155 |
| 156 error_count = style_processor.error_count | 156 error_count = style_processor.error_count |
| 157 file_count = file_reader.file_count | 157 file_count = file_reader.file_count |
| 158 delete_only_file_count = file_reader.delete_only_file_count | 158 delete_only_file_count = file_reader.delete_only_file_count |
| 159 | 159 |
| 160 _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) |
| 161 # 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. |
| 162 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) |
| OLD | NEW |