style: add .editorconfig for code formatting. see issu #25

This commit is contained in:
leo 2024-03-18 09:37:06 +08:00
parent a8eeea4f78
commit 18aaa0a143
225 changed files with 7781 additions and 3911 deletions

View file

@ -1,8 +1,11 @@
using System;
namespace SourceGit.Commands {
public class Statistics : Command {
public Statistics(string repo) {
namespace SourceGit.Commands
{
public class Statistics : Command
{
public Statistics(string repo)
{
_statistics = new Models.Statistics();
WorkingDirectory = repo;
@ -10,13 +13,15 @@ namespace SourceGit.Commands {
Args = $"log --date-order --branches --remotes --since=\"{_statistics.Since()}\" --pretty=format:\"%ct$%cn\"";
}
public Models.Statistics Result() {
public Models.Statistics Result()
{
Exec();
_statistics.Complete();
return _statistics;
}
protected override void OnReadline(string line) {
protected override void OnReadline(string line)
{
var dateEndIdx = line.IndexOf('$', StringComparison.Ordinal);
if (dateEndIdx == -1) return;
@ -27,6 +32,6 @@ namespace SourceGit.Commands {
_statistics.AddCommit(line.Substring(dateEndIdx + 1), date);
}
private Models.Statistics _statistics = null;
private readonly Models.Statistics _statistics = null;
}
}
}