Skip to content

Commit 4610f70

Browse files
committed
code_style: run dotnet format
1 parent ed62174 commit 4610f70

29 files changed

+48
-76
lines changed

src/App.axaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ public static void SetTheme(string theme, string colorsFile)
163163
try
164164
{
165165
var resDic = new ResourceDictionary();
166-
166+
167167
var schema = JsonSerializer.Deserialize(File.ReadAllText(colorsFile), JsonCodeGen.Default.DictionaryStringString);
168168
foreach (var kv in schema)
169169
resDic[kv.Key] = Color.Parse(kv.Value);
170170

171171
app.Resources.MergedDictionaries.Add(resDic);
172172
app._colorOverrides = resDic;
173-
}
173+
}
174174
catch
175175
{
176176
}

src/Commands/QueryBranches.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ protected override void OnReadline(string line)
5252
var refName = parts[0];
5353
if (refName.EndsWith("/HEAD", StringComparison.Ordinal))
5454
return;
55-
55+
5656
if (refName.StartsWith(PREFIX_DETACHED, StringComparison.Ordinal))
5757
{
5858
branch.IsHead = true;
5959
}
60-
60+
6161
if (refName.StartsWith(PREFIX_LOCAL, StringComparison.Ordinal))
6262
{
6363
branch.Name = refName.Substring(PREFIX_LOCAL.Length);

src/Commands/QueryCommits.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ protected override void OnReadline(string line)
5757
if (line.Equals(_endOfBodyToken, StringComparison.Ordinal))
5858
{
5959
_nextPartIdx = 0;
60-
if (!string.IsNullOrEmpty(_current.Message)) _current.Message = _current.Message.Trim();
60+
if (!string.IsNullOrEmpty(_current.Message))
61+
_current.Message = _current.Message.Trim();
6162
}
6263
else
6364
{

src/Commands/QuerySingleCommit.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ namespace SourceGit.Commands
66
{
77
public class QuerySingleCommit : Command
88
{
9-
public QuerySingleCommit(string repo, string sha) {
9+
public QuerySingleCommit(string repo, string sha)
10+
{
1011
WorkingDirectory = repo;
1112
Context = repo;
1213
Args = $"show --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B -s {sha}";
@@ -19,7 +20,7 @@ public Models.Commit Result()
1920
{
2021
var commit = new Models.Commit();
2122
var lines = rs.StdOut.Split('\n');
22-
if (lines.Length < 8)
23+
if (lines.Length < 8)
2324
return null;
2425

2526
commit.SHA = lines[0];

src/Converters/ChangeViewModeConverters.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,5 @@ public static class ChangeViewModeConverters
1919
return App.Current?.FindResource("Icons.Tree") as StreamGeometry;
2020
}
2121
});
22-
23-
public static readonly FuncValueConverter<Models.ChangeViewMode, bool> IsList =
24-
new FuncValueConverter<Models.ChangeViewMode, bool>(v => v == Models.ChangeViewMode.List);
25-
26-
public static readonly FuncValueConverter<Models.ChangeViewMode, bool> IsGrid =
27-
new FuncValueConverter<Models.ChangeViewMode, bool>(v => v == Models.ChangeViewMode.Grid);
28-
29-
public static readonly FuncValueConverter<Models.ChangeViewMode, bool> IsTree =
30-
new FuncValueConverter<Models.ChangeViewMode, bool>(v => v == Models.ChangeViewMode.Tree);
3122
}
3223
}

src/Converters/DecoratorTypeConverters.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static class DecoratorTypeConverters
3838
});
3939

4040
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
41-
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
42-
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
41+
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
42+
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
4343
? FontWeight.Bold : FontWeight.Regular
4444
);
4545
}

src/Converters/LauncherPageConverters.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ public static class LauncherPageConverters
2525
var selected = array[1] as ViewModels.LauncherPage;
2626
var collections = array[2] as AvaloniaList<ViewModels.LauncherPage>;
2727

28-
if (selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected)))
29-
{
30-
return false;
31-
}
32-
else
33-
{
34-
return true;
35-
}
28+
return selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected));
3629
});
3730
}
3831
}

src/Converters/StringConverters.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,11 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
3030
{
3131
var theme = (string)value;
3232
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
33-
{
3433
return ThemeVariant.Light;
35-
}
3634
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
37-
{
3835
return ThemeVariant.Dark;
39-
}
4036
else
41-
{
4237
return ThemeVariant.Default;
43-
}
4438
}
4539

4640
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
@@ -70,7 +64,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
7064

7165
public static readonly FuncValueConverter<string, string> ToShortSHA =
7266
new FuncValueConverter<string, string>(v => v == null ? string.Empty : (v.Length > 10 ? v.Substring(0, 10) : v));
73-
67+
7468
public static readonly FuncValueConverter<string, bool> UnderRecommendGitVersion =
7569
new(v =>
7670
{

src/Converters/WindowStateConverters.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,20 @@ public static class WindowStateConverters
1212
new FuncValueConverter<WindowState, Thickness>(state =>
1313
{
1414
if (OperatingSystem.IsWindows() && state == WindowState.Maximized)
15-
{
1615
return new Thickness(6);
17-
}
1816
else if (OperatingSystem.IsLinux() && state != WindowState.Maximized)
19-
{
2017
return new Thickness(6);
21-
}
2218
else
23-
{
2419
return new Thickness(0);
25-
}
2620
});
2721

2822
public static readonly FuncValueConverter<WindowState, GridLength> ToTitleBarHeight =
2923
new FuncValueConverter<WindowState, GridLength>(state =>
3024
{
3125
if (state == WindowState.Maximized)
32-
{
3326
return new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
34-
}
3527
else
36-
{
3728
return new GridLength(38);
38-
}
3929
});
4030

4131
public static readonly FuncValueConverter<WindowState, bool> IsNormal =

src/Models/TreeDataGridSelectionModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ e.Source is Control source &&
182182
{
183183
var focus = _source.Rows[row.RowIndex];
184184
if (focus is IExpander expander && HasChildren(focus))
185-
expander.IsExpanded = !expander.IsExpanded;
185+
expander.IsExpanded = !expander.IsExpanded;
186186
else
187187
_rowDoubleTapped?.Invoke(this, e);
188188

@@ -455,7 +455,7 @@ private bool HasChildren(IRow row)
455455
foreach (var c in children)
456456
return true;
457457
}
458-
458+
459459
return false;
460460
}
461461
}

0 commit comments

Comments
 (0)