Log Only
This commit is contained in:
parent
446b5587be
commit
ecc1cf3a62
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
@ -11,6 +11,12 @@
|
|||||||
"preLaunchTask": "build",
|
"preLaunchTask": "build",
|
||||||
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
|
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
|
||||||
"args": [
|
"args": [
|
||||||
|
"s",
|
||||||
|
"X",
|
||||||
|
"L:/DevOps/Mesa_FI/MesaFabApproval",
|
||||||
|
"Day-Helper-2024-01-08",
|
||||||
|
"L:/DevOps/Mesa_FI/MesaFabApproval/Fab2ApprovalSystem/Controllers",
|
||||||
|
"true",
|
||||||
"s",
|
"s",
|
||||||
"X",
|
"X",
|
||||||
"D:/5-Other-Small/Kanban-mestsa003/ART-SPS/2024/PI4/Sprint-4.1/126448-User-Story/.files/638675719896500885",
|
"D:/5-Other-Small/Kanban-mestsa003/ART-SPS/2024/PI4/Sprint-4.1/126448-User-Story/.files/638675719896500885",
|
||||||
|
@ -277,12 +277,18 @@ internal static partial class Helper20240108
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool SortFile(ILogger<Worker> logger, string cSharpFile, string[] lines)
|
private static bool SortFile(ILogger<Worker> logger, bool logOnly, string cSharpFile, string[] lines)
|
||||||
{
|
{
|
||||||
bool result;
|
bool result;
|
||||||
ReadOnlyCollection<Method> methods = GetMethods(cSharpFile, logger, lines);
|
ReadOnlyCollection<Method> methods = GetMethods(cSharpFile, logger, lines);
|
||||||
if (methods.Count == 0)
|
if (methods.Count == 0)
|
||||||
result = false;
|
result = false;
|
||||||
|
else if (logOnly)
|
||||||
|
{
|
||||||
|
foreach (Method method in methods.OrderBy(l => l.Name))
|
||||||
|
logger.LogInformation("{cSharpFile} - {Name} has {lines} line(s)", cSharpFile, method.Name, (method.EndLine - method.StartLine).ToString("000000"));
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
result = WriteAllLines(cSharpFile, lines, methods);
|
result = WriteAllLines(cSharpFile, lines, methods);
|
||||||
return result;
|
return result;
|
||||||
@ -295,11 +301,12 @@ internal static partial class Helper20240108
|
|||||||
string[] lines;
|
string[] lines;
|
||||||
bool usePathCombine = true;
|
bool usePathCombine = true;
|
||||||
long ticks = DateTime.Now.Ticks;
|
long ticks = DateTime.Now.Ticks;
|
||||||
|
bool logOnly = bool.Parse(args[3]);
|
||||||
logger.LogInformation("{ticks}", ticks);
|
logger.LogInformation("{ticks}", ticks);
|
||||||
string directory = Path.GetFullPath(args[2]);
|
string directory = Path.GetFullPath(args[2]);
|
||||||
string repositoryDirectory = Path.GetFullPath(args[0]);
|
string repositoryDirectory = Path.GetFullPath(args[0]);
|
||||||
string[] cSharpFiles = Directory.GetFiles(directory, "*.cs", SearchOption.AllDirectories);
|
string[] cSharpFiles = Directory.GetFiles(directory, "*.cs", SearchOption.AllDirectories);
|
||||||
ReadOnlyCollection<string> gitOthersModifiedAndDeletedExcludingStandardFiles = Helpers.HelperGit.GetOthersModifiedAndDeletedExcludingStandardFiles(repositoryDirectory, usePathCombine, cancellationToken);
|
ReadOnlyCollection<string> gitOthersModifiedAndDeletedExcludingStandardFiles = logOnly ? new(cSharpFiles) : Helpers.HelperGit.GetOthersModifiedAndDeletedExcludingStandardFiles(repositoryDirectory, usePathCombine, cancellationToken);
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
foreach (string cSharpFile in cSharpFiles)
|
foreach (string cSharpFile in cSharpFiles)
|
||||||
@ -307,11 +314,11 @@ internal static partial class Helper20240108
|
|||||||
if (!gitOthersModifiedAndDeletedExcludingStandardFiles.Contains(cSharpFile))
|
if (!gitOthersModifiedAndDeletedExcludingStandardFiles.Contains(cSharpFile))
|
||||||
continue;
|
continue;
|
||||||
lines = File.ReadAllLines(cSharpFile);
|
lines = File.ReadAllLines(cSharpFile);
|
||||||
check = SortFile(logger, cSharpFile, lines);
|
check = SortFile(logger, logOnly, cSharpFile, lines);
|
||||||
if (check && !result)
|
if (check && !result)
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
if (!result)
|
if (logOnly || !result)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<PackageReference Include="MetadataExtractor" Version="2.8.1" />
|
<PackageReference Include="MetadataExtractor" Version="2.8.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
|
||||||
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="8.0.10" />
|
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="8.0.11" />
|
||||||
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||||
<PackageReference Include="TextCopy" Version="6.2.1" />
|
<PackageReference Include="TextCopy" Version="6.2.1" />
|
||||||
<PackageReference Include="WindowsShortcutFactory" Version="1.2.0" />
|
<PackageReference Include="WindowsShortcutFactory" Version="1.2.0" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user