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

Side by Side Diff: tools/gardening/lib/src/util.dart

Issue 3011813002: Updated sanitizeCategory to better account for category names. (Closed)
Patch Set: Modified sanitizeCategory to accout for different lengths of channel Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:args/args.dart'; 9 import 'package:args/args.dart';
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (argResults['cache'] != null) { 101 if (argResults['cache'] != null) {
102 cache.base = Uri.base.resolve('${argResults['cache']}/'); 102 cache.base = Uri.base.resolve('${argResults['cache']}/');
103 } 103 }
104 if (argResults['no-cache']) { 104 if (argResults['no-cache']) {
105 cache.base = null; 105 cache.base = null;
106 } 106 }
107 } 107 }
108 108
109 /// Strips un-wanted characters from string [category] from CBE json. 109 /// Strips un-wanted characters from string [category] from CBE json.
110 String sanitizeCategory(String category) { 110 String sanitizeCategory(String category) {
111 // Category name starts with either two or three numbers and 111 var reg = new RegExp(r"^[0-9]+(.*)\|all$");
112 // end with |all. Instead of doing any fancy regular-expr, 112 var match = reg.firstMatch(category);
113 // we just test if third char is a number. 113 return match != null ? match.group(1) : category;
114 return category.substring(
115 category.codeUnitAt(2) <= 64 ? 3 : 2, category.length - 4);
116 } 114 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698