Fix various strong mode issues. (#14284)
This commit is contained in:
committed by
GitHub
parent
122796137b
commit
340d9e00cf
@@ -15,9 +15,11 @@ const double todoCost = 1009.0; // about two average SWE days, in dollars
|
||||
const double ignoreCost = 2003.0; // four average SWE days, in dollars
|
||||
const double pythonCost = 3001.0; // six average SWE days, in dollars
|
||||
const double skipCost = 2473.0; // 20 hours: 5 to fix the issue we're ignoring, 15 to fix the bugs we missed because the test was off
|
||||
const double asDynamicCost = 2003.0; // same as ignoring analyzer warning
|
||||
|
||||
final RegExp todoPattern = new RegExp(r'(?://|#) *TODO');
|
||||
final RegExp ignorePattern = new RegExp(r'// *ignore:');
|
||||
final RegExp asDynamicPattern = new RegExp(r'as dynamic');
|
||||
|
||||
Future<double> findCostsForFile(File file) async {
|
||||
if (path.extension(file.path) == '.py')
|
||||
@@ -33,6 +35,8 @@ Future<double> findCostsForFile(File file) async {
|
||||
total += todoCost;
|
||||
if (line.contains(ignorePattern))
|
||||
total += ignoreCost;
|
||||
if (line.contains(asDynamicPattern))
|
||||
total += asDynamicCost;
|
||||
if (isTest && line.contains('skip:'))
|
||||
total += skipCost;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user