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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 rel_paths = [] | 68 rel_paths = [] |
69 for path in paths: | 69 for path in paths: |
70 rel_path = filesystem.relpath(path, checkout_root) | 70 rel_path = filesystem.relpath(path, checkout_root) |
71 if rel_path.startswith(filesystem.pardir): | 71 if rel_path.startswith(filesystem.pardir): |
72 # Then the path is not below the checkout root. Since all | 72 # Then the path is not below the checkout root. Since all |
73 # paths should be interpreted relative to the same root, | 73 # paths should be interpreted relative to the same root, |
74 # do not interpret any of the paths as relative to the | 74 # do not interpret any of the paths as relative to the |
75 # checkout root. Interpret all of them relative to the | 75 # checkout root. Interpret all of them relative to the |
76 # current working directory, and do not change the current | 76 # current working directory, and do not change the current |
77 # working directory. | 77 # working directory. |
78 _log.warn( | 78 _log.warning( |
79 """Path-dependent style checks may not work correctly: | 79 """Path-dependent style checks may not work correctly: |
80 | 80 |
81 One of the given paths is outside the WebKit checkout of the current | 81 One of the given paths is outside the WebKit checkout of the current |
82 working directory: | 82 working directory: |
83 | 83 |
84 Path: %s | 84 Path: %s |
85 Checkout root: %s | 85 Checkout root: %s |
86 | 86 |
87 Pass only files below the checkout root to ensure correct results. | 87 Pass only files below the checkout root to ensure correct results. |
88 See the help documentation for more info. | 88 See the help documentation for more info. |
89 """ | 89 """, |
90 % (path, checkout_root)) | 90 path, checkout_root) |
91 | 91 |
92 return paths | 92 return paths |
93 rel_paths.append(rel_path) | 93 rel_paths.append(rel_path) |
94 # If we got here, the conversion was successful. | 94 # If we got here, the conversion was successful. |
95 paths = rel_paths | 95 paths = rel_paths |
96 | 96 |
97 _log.debug("Changing to checkout root: " + checkout_root) | 97 _log.debug("Changing to checkout root: " + checkout_root) |
98 filesystem.chdir(checkout_root) | 98 filesystem.chdir(checkout_root) |
99 | 99 |
100 return paths | 100 return paths |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 else: | 151 else: |
152 changed_files = paths if options.diff_files else None | 152 changed_files = paths if options.diff_files else None |
153 patch = host.scm().create_patch(options.git_commit, changed_files=ch
anged_files) | 153 patch = host.scm().create_patch(options.git_commit, changed_files=ch
anged_files) |
154 patch_checker = PatchReader(file_reader) | 154 patch_checker = PatchReader(file_reader) |
155 patch_checker.check(patch) | 155 patch_checker.check(patch) |
156 | 156 |
157 error_count = style_processor.error_count | 157 error_count = style_processor.error_count |
158 file_count = file_reader.file_count | 158 file_count = file_reader.file_count |
159 delete_only_file_count = file_reader.delete_only_file_count | 159 delete_only_file_count = file_reader.delete_only_file_count |
160 | 160 |
161 _log.info("Total errors found: %d in %d files" % (error_count, file_coun
t)) | 161 _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. | 162 # 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) | 163 return error_count > 0 or (file_count == 0 and delete_only_file_count ==
0) |
OLD | NEW |