prepareCode method

void prepareCode(
  1. String projectRootPath,
  2. int lineLength, {
  3. required bool usingGit,
})

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);
  }
}