prepareCode method
Ensure that all code is correctly formatted. and that it passes all tests.
Implementation
void prepareCode(String projectRootPath, int lineLength,
{required bool usingGit}) {
// ensure that all code is correctly formatted.
formatCode(projectRootPath, usingGit: usingGit, lineLength: lineLength);
final progress = start('dart analyze',
workingDirectory: projectRootPath,
nothrow: true,
progress: Progress.print());
if (progress.exitCode != 0) {
printerr(
red('dart analyze failed. Please fix the errors and try again.'));
exit(1);
}
}