ElixirCommandRunner constructor

ElixirCommandRunner()

Implementation

ElixirCommandRunner()
    : super(
        'elixir',
        'Tool for commenting `dart analyze` results to GitHub PullRequest.',
      ) {
  argParser.addFlags([
    VersionFlag(),
  ]);

  final token = Platform.environment['GITHUB_TOKEN'] ?? '';

  final client = GitHubClient(
    client: Client(),
    token: token,
  );

  final repository = GitHubRepository(client: client);
  final deletePreviousCommentsUseCase = DeletePreviousCommentsUseCase(
    gitHubRepository: repository,
  );
  final commentIndicatesUseCase = CommentIndicatesUseCase(
    gitHubRepository: repository,
  );
  addCommand(
    RunCommand(
      deletePreviousComments: deletePreviousCommentsUseCase,
      commentIndicates: commentIndicatesUseCase,
    ),
  );
}