Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit b297b31

Browse files
committed
style: apply code style
1 parent 2bdafca commit b297b31

File tree

227 files changed

+12879
-12374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+12879
-12374
lines changed

Cement.Net/CementEntry.csproj

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\dependencies\vostok.devtools\git-commit-to-assembly-title\Vostok.Tools.GitCommit2AssemblyTitle.props" />
3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<RootNamespace>cm</RootNamespace>
6-
<AssemblyName>cm</AssemblyName>
7-
<TargetFramework>net6.0</TargetFramework>
8-
<Product>Cement.Net</Product>
9-
<Copyright>Copyright © 2022</Copyright>
10-
<Version>5.0.0</Version>
11-
</PropertyGroup>
12-
<ItemGroup>
13-
<ProjectReference Include="..\Commands\Commands.csproj" />
14-
<ProjectReference Include="..\Common\Common.csproj" />
15-
</ItemGroup>
16-
</Project>
2+
<Import Project="..\dependencies\vostok.devtools\git-commit-to-assembly-title\Vostok.Tools.GitCommit2AssemblyTitle.props" />
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<RootNamespace>cm</RootNamespace>
6+
<AssemblyName>cm</AssemblyName>
7+
<TargetFramework>net6.0</TargetFramework>
8+
<Product>Cement.Net</Product>
9+
<Copyright>Copyright © 2022</Copyright>
10+
<Version>5.0.0</Version>
11+
</PropertyGroup>
12+
<ItemGroup>
13+
<ProjectReference Include="..\Commands\Commands.csproj" />
14+
<ProjectReference Include="..\Common\Common.csproj" />
15+
</ItemGroup>
16+
</Project>

Cement.Net/EntryPoint.cs

+102-102
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
1-
using System;
2-
using System.Linq;
3-
using System.Threading;
4-
using Commands;
5-
using Common;
6-
using Common.Logging;
7-
using Microsoft.Extensions.Logging;
8-
9-
namespace cm
10-
{
11-
internal static class EntryPoint
12-
{
13-
private static ILogger logger;
14-
15-
private static int Main(string[] args)
16-
{
17-
LogManager.SetDebugLoggingLevel();
18-
19-
logger = LogManager.GetLogger(typeof(EntryPoint));
20-
21-
ThreadPoolSetUp(Helper.MaxDegreeOfParallelism);
22-
args = FixArgs(args);
23-
var exitCode = TryRun(args);
24-
25-
ConsoleWriter.Shared.ResetProgress();
26-
27-
var command = args[0];
28-
if (command != "complete" && command != "check-pre-commit"
29-
&& (command != "help" || !args.Contains("--gen")))
30-
SelfUpdate.UpdateIfOld();
31-
32-
logger.LogInformation($"Exit code: {exitCode}");
33-
34-
LogManager.DisposeLoggers();
35-
36-
return exitCode == 0 ? 0 : 13;
37-
}
38-
39-
private static string[] FixArgs(string[] args)
40-
{
41-
if (args.Length > 0 && args[0].Equals("cm"))
42-
args = args.Skip(1).ToArray();
43-
if (args.Length == 0)
44-
args = new[] {"help"};
45-
if (args.Contains("--help") || args.Contains("/?"))
46-
args = new[] {"help", args[0]};
47-
return args;
48-
}
49-
50-
private static int TryRun(string[] args)
51-
{
52-
try
53-
{
54-
return Run(args);
55-
}
56-
catch (CementException e)
57-
{
58-
ConsoleWriter.Shared.WriteError(e.Message);
59-
logger.LogError(e, e.Message);
60-
return -1;
61-
}
62-
catch (Exception e)
63-
{
64-
if (e.InnerException != null && e.InnerException is CementException cementException)
65-
{
66-
ConsoleWriter.Shared.WriteError(cementException.Message);
67-
logger.LogError(e.InnerException, e.InnerException.Message);
68-
}
69-
else
70-
{
71-
ConsoleWriter.Shared.WriteError(e.Message);
72-
ConsoleWriter.Shared.WriteError(e.StackTrace);
73-
logger.LogError(e, e.Message);
74-
}
75-
76-
return -1;
77-
}
78-
}
79-
80-
private static int Run(string[] args)
81-
{
82-
var commands = CommandsList.Commands;
83-
if (commands.ContainsKey(args[0]))
84-
{
85-
return commands[args[0]].Run(args);
86-
}
87-
88-
if (CementSettingsRepository.Get().UserCommands.ContainsKey(args[0]))
89-
return new UserCommand().Run(args);
90-
91-
ConsoleWriter.Shared.WriteError("Bad command: '" + args[0] + "'");
92-
return -1;
93-
}
94-
95-
private static void ThreadPoolSetUp(int count)
96-
{
97-
int num = Math.Min(count, short.MaxValue);
98-
ThreadPool.SetMaxThreads(short.MaxValue, short.MaxValue);
99-
ThreadPool.SetMinThreads(num, num);
100-
}
101-
}
102-
}
1+
using System;
2+
using System.Linq;
3+
using System.Threading;
4+
using Commands;
5+
using Common;
6+
using Common.Logging;
7+
using Microsoft.Extensions.Logging;
8+
9+
namespace cm
10+
{
11+
internal static class EntryPoint
12+
{
13+
private static ILogger logger;
14+
15+
private static int Main(string[] args)
16+
{
17+
LogManager.SetDebugLoggingLevel();
18+
19+
logger = LogManager.GetLogger(typeof(EntryPoint));
20+
21+
ThreadPoolSetUp(Helper.MaxDegreeOfParallelism);
22+
args = FixArgs(args);
23+
var exitCode = TryRun(args);
24+
25+
ConsoleWriter.Shared.ResetProgress();
26+
27+
var command = args[0];
28+
if (command != "complete" && command != "check-pre-commit"
29+
&& (command != "help" || !args.Contains("--gen")))
30+
SelfUpdate.UpdateIfOld();
31+
32+
logger.LogInformation($"Exit code: {exitCode}");
33+
34+
LogManager.DisposeLoggers();
35+
36+
return exitCode == 0 ? 0 : 13;
37+
}
38+
39+
private static string[] FixArgs(string[] args)
40+
{
41+
if (args.Length > 0 && args[0].Equals("cm"))
42+
args = args.Skip(1).ToArray();
43+
if (args.Length == 0)
44+
args = new[] {"help"};
45+
if (args.Contains("--help") || args.Contains("/?"))
46+
args = new[] {"help", args[0]};
47+
return args;
48+
}
49+
50+
private static int TryRun(string[] args)
51+
{
52+
try
53+
{
54+
return Run(args);
55+
}
56+
catch (CementException e)
57+
{
58+
ConsoleWriter.Shared.WriteError(e.Message);
59+
logger.LogError(e, e.Message);
60+
return -1;
61+
}
62+
catch (Exception e)
63+
{
64+
if (e.InnerException != null && e.InnerException is CementException cementException)
65+
{
66+
ConsoleWriter.Shared.WriteError(cementException.Message);
67+
logger.LogError(e.InnerException, e.InnerException.Message);
68+
}
69+
else
70+
{
71+
ConsoleWriter.Shared.WriteError(e.Message);
72+
ConsoleWriter.Shared.WriteError(e.StackTrace);
73+
logger.LogError(e, e.Message);
74+
}
75+
76+
return -1;
77+
}
78+
}
79+
80+
private static int Run(string[] args)
81+
{
82+
var commands = CommandsList.Commands;
83+
if (commands.ContainsKey(args[0]))
84+
{
85+
return commands[args[0]].Run(args);
86+
}
87+
88+
if (CementSettingsRepository.Get().UserCommands.ContainsKey(args[0]))
89+
return new UserCommand().Run(args);
90+
91+
ConsoleWriter.Shared.WriteError("Bad command: '" + args[0] + "'");
92+
return -1;
93+
}
94+
95+
private static void ThreadPoolSetUp(int count)
96+
{
97+
int num = Math.Min(count, short.MaxValue);
98+
ThreadPool.SetMaxThreads(short.MaxValue, short.MaxValue);
99+
ThreadPool.SetMinThreads(num, num);
100+
}
101+
}
102+
}

Cement.Net/Properties/AssemblyInfo.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.Reflection;
2-
using System.Runtime.InteropServices;
3-
4-
// Setting ComVisible to false makes the types in this assembly not visible
5-
// to COM components. If you need to access a type in this assembly from
6-
// COM, set the ComVisible attribute to true on that type.
7-
[assembly: ComVisible(false)]
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
// Setting ComVisible to false makes the types in this assembly not visible
5+
// to COM components. If you need to access a type in this assembly from
6+
// COM, set the ComVisible attribute to true on that type.
7+
[assembly: ComVisible(false)]

0 commit comments

Comments
 (0)