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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

Issue 2305143003: webkitpy: Make all regex strings use raw string literals. (Closed)
Patch Set: Make all regex strings raw strings. Created 4 years, 3 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 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
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 are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if state != 'start': 303 if state != 'start':
304 warnings.append('"%s" is not at the start of the line.' % to ken) 304 warnings.append('"%s" is not at the start of the line.' % to ken)
305 break 305 break
306 if token.startswith(WEBKIT_BUG_PREFIX): 306 if token.startswith(WEBKIT_BUG_PREFIX):
307 bugs.append(token) 307 bugs.append(token)
308 elif token.startswith(CHROMIUM_BUG_PREFIX): 308 elif token.startswith(CHROMIUM_BUG_PREFIX):
309 bugs.append(token) 309 bugs.append(token)
310 elif token.startswith(V8_BUG_PREFIX): 310 elif token.startswith(V8_BUG_PREFIX):
311 bugs.append(token) 311 bugs.append(token)
312 else: 312 else:
313 match = re.match('Bug\((\w+)\)$', token) 313 match = re.match(r'Bug\((\w+)\)$', token)
314 if not match: 314 if not match:
315 warnings.append('unrecognized bug identifier "%s"' % tok en) 315 warnings.append('unrecognized bug identifier "%s"' % tok en)
316 break 316 break
317 else: 317 else:
318 bugs.append(token) 318 bugs.append(token)
319 elif token == '[': 319 elif token == '[':
320 if state == 'start': 320 if state == 'start':
321 state = 'configuration' 321 state = 'configuration'
322 elif state == 'name_found': 322 elif state == 'name_found':
323 state = 'expectations' 323 state = 'expectations'
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 # If reconstitute_only_these is an empty list, we want to return ori ginal_string. 1189 # If reconstitute_only_these is an empty list, we want to return ori ginal_string.
1190 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey. 1190 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey.
1191 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these: 1191 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these:
1192 return expectation_line.to_string(test_configuration_converter) 1192 return expectation_line.to_string(test_configuration_converter)
1193 return expectation_line.original_string 1193 return expectation_line.original_string
1194 1194
1195 def nones_out(expectation_line): 1195 def nones_out(expectation_line):
1196 return expectation_line is not None 1196 return expectation_line is not None
1197 1197
1198 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) 1198 return "\n".join(filter(nones_out, map(serialize, expectation_lines)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698