You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/xtro-sharpie/xtro-sanity/Sanitizer.cs
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ static void NoFixedTodo ()
128
128
if(!IsEntry(entry))
129
129
continue;
130
130
if(!specific.Contains(entry)){
131
-
Log($"?fixed-todo? Entry '{entry}' in '{Path.GetFileName(file)}' is not found in corresponding '{Path.GetFileName(raw)}' file");
131
+
LogSanitizable($"?fixed-todo? Entry '{entry}' in '{Path.GetFileName(file)}' is not found in corresponding '{Path.GetFileName(raw)}' file");
132
132
failures.Add(entry);
133
133
}
134
134
}
@@ -137,7 +137,7 @@ static void NoFixedTodo ()
137
137
foreach(varentryinentries){
138
138
if(!IsEntry(entry))
139
139
continue;
140
-
Log($"?fixed-todo? Entry '{entry}' in '{Path.GetFileName(file)}' might be fixed since there's no corresponding '{Path.GetFileName(raw)}' file");
140
+
LogSanitizable($"?fixed-todo? Entry '{entry}' in '{Path.GetFileName(file)}' might be fixed since there's no corresponding '{Path.GetFileName(raw)}' file");
141
141
failures.Add(entry);
142
142
}
143
143
}
@@ -160,7 +160,7 @@ static void NoEmptyTodo ()
160
160
if(!IsIncluded(file))
161
161
continue;
162
162
if(!(File.ReadLines(file).Count()>0)){
163
-
Log($"?empty-todo? File '{Path.GetFileName(file)}' is empty. Empty todo files should be removed.");
163
+
LogSanitizable($"?empty-todo? File '{Path.GetFileName(file)}' is empty. Empty todo files should be removed.");
164
164
if(Autosanitize)
165
165
File.Delete(file);
166
166
}
@@ -177,6 +177,15 @@ public static void Log (string s)
177
177
count++;
178
178
}
179
179
180
+
publicstaticvoidLogSanitizable(strings)
181
+
{
182
+
if(Autosanitize){
183
+
Console.WriteLine($"(sanitized) {s}");
184
+
return;
185
+
}
186
+
Log(s);
187
+
}
188
+
180
189
publicstaticintMain(string[]args)
181
190
{
182
191
directory=args.Length==0?".":args[0];
@@ -250,11 +259,11 @@ public static int Main (string [] args)
Log($"?not-common? {entry} in '{Path.Combine(directory,$"common-{fx}.ignore")}': not in {string.Join(", ",notFound.Select(v =>v.Platform))}");
266
+
LogSanitizable($"?not-common? {entry} in '{Path.Combine(directory,$"common-{fx}.ignore")}': not in {string.Join(", ",notFound.Select(v =>v.Platform))}");
258
267
unknownFailures.Add(entry);
259
268
if(Autosanitize){
260
269
foreach(varnfinfoundRaws){
@@ -294,7 +303,7 @@ public static int Main (string [] args)
294
303
continue;
295
304
if(raws.Contains(entry))
296
305
continue;
297
-
Log($"?unknown-entry? {entry} in '{shortname}'");
306
+
LogSanitizable($"?unknown-entry? {entry} in '{shortname}'");
298
307
failures.Add(entry);
299
308
}
300
309
if(failures.Count>0&&Autosanitize){
@@ -327,8 +336,7 @@ public static int Main (string [] args)
327
336
328
337
// useful when updating stuff locally - we report but we don't fail
0 commit comments