@@ -31,7 +31,7 @@ public DotNetLanguageSpecificChecks(
3131 _logger = logger ;
3232 }
3333
34- public async Task < CLICheckResponse > CheckGeneratedCode ( string packagePath , bool fixCheckErrors = false , CancellationToken ct = default )
34+ public async Task < PackageCheckResponse > CheckGeneratedCode ( string packagePath , bool fixCheckErrors = false , CancellationToken ct = default )
3535 {
3636 try
3737 {
@@ -48,15 +48,15 @@ public async Task<CLICheckResponse> CheckGeneratedCode(string packagePath, bool
4848 if ( serviceDirectory == null )
4949 {
5050 _logger . LogError ( "Failed to determine service directory from package path: {PackagePath}" , packagePath ) ;
51- return new CLICheckResponse ( 1 , "" , "Failed to determine service directory from the provided package path." ) ;
51+ return new PackageCheckResponse ( 1 , "" , "Failed to determine service directory from the provided package path." ) ;
5252 }
5353
5454 var repoRoot = _gitHelper . DiscoverRepoRoot ( packagePath ) ;
5555 var scriptPath = Path . Combine ( repoRoot , "eng" , "scripts" , "CodeChecks.ps1" ) ;
5656 if ( ! File . Exists ( scriptPath ) )
5757 {
5858 _logger . LogError ( "Code checks script not found at: {ScriptPath}" , scriptPath ) ;
59- return new CLICheckResponse ( 1 , "" , $ "Code checks script not found at: { scriptPath } ") ;
59+ return new PackageCheckResponse ( 1 , "" , $ "Code checks script not found at: { scriptPath } ") ;
6060 }
6161
6262 var args = new [ ] { scriptPath , "-ServiceDirectory" , serviceDirectory , "-SpellCheckPublicApiSurface" } ;
@@ -66,22 +66,22 @@ public async Task<CLICheckResponse> CheckGeneratedCode(string packagePath, bool
6666 if ( result . ExitCode == 0 )
6767 {
6868 _logger . LogInformation ( "Generated code checks completed successfully" ) ;
69- return new CLICheckResponse ( result . ExitCode , result . Output ) ;
69+ return new PackageCheckResponse ( result . ExitCode , result . Output ) ;
7070 }
7171 else
7272 {
7373 _logger . LogWarning ( "Generated code checks for package at {PackagePath} failed with exit code {ExitCode}" , packagePath , result . ExitCode ) ;
74- return new CLICheckResponse ( result . ExitCode , result . Output , "Generated code checks failed" ) ;
74+ return new PackageCheckResponse ( result . ExitCode , result . Output , "Generated code checks failed" ) ;
7575 }
7676 }
7777 catch ( Exception ex )
7878 {
7979 _logger . LogError ( ex , "Error running generated code checks at {PackagePath}" , packagePath ) ;
80- return new CLICheckResponse ( 1 , "" , $ "Error running generated code checks: { ex . Message } ") ;
80+ return new PackageCheckResponse ( 1 , "" , $ "Error running generated code checks: { ex . Message } ") ;
8181 }
8282 }
8383
84- public async Task < CLICheckResponse > CheckAotCompat ( string packagePath , bool fixCheckErrors = false , CancellationToken ct = default )
84+ public async Task < PackageCheckResponse > CheckAotCompat ( string packagePath , bool fixCheckErrors = false , CancellationToken ct = default )
8585 {
8686 try
8787 {
@@ -99,22 +99,22 @@ public async Task<CLICheckResponse> CheckAotCompat(string packagePath, bool fixC
9999 if ( serviceDirectory == null || packageName == null )
100100 {
101101 _logger . LogError ( "Failed to determine service directory or package name from package path: {PackagePath}" , packagePath ) ;
102- return new CLICheckResponse ( 1 , "" , "Failed to determine service directory or package name from the provided package path." ) ;
102+ return new PackageCheckResponse ( 1 , "" , "Failed to determine service directory or package name from the provided package path." ) ;
103103 }
104104
105105 var isAotOptedOut = await CheckAotCompatOptOut ( packagePath , packageName , ct ) ;
106106 if ( isAotOptedOut )
107107 {
108108 _logger . LogInformation ( "AOT compatibility check skipped - AotCompatOptOut is set to true in project file" ) ;
109- return new CLICheckResponse ( 0 , "AOT compatibility check skipped - AotCompatOptOut is set to true in project file" ) ;
109+ return new PackageCheckResponse ( 0 , "AOT compatibility check skipped - AotCompatOptOut is set to true in project file" ) ;
110110 }
111111
112112 var repoRoot = _gitHelper . DiscoverRepoRoot ( packagePath ) ;
113113 var scriptPath = Path . Combine ( repoRoot , "eng" , "scripts" , "compatibility" , "Check-AOT-Compatibility.ps1" ) ;
114114 if ( ! File . Exists ( scriptPath ) )
115115 {
116116 _logger . LogError ( "AOT compatibility script not found at: {ScriptPath}" , scriptPath ) ;
117- return new CLICheckResponse ( 1 , "" , $ "AOT compatibility script not found at: { scriptPath } ") ;
117+ return new PackageCheckResponse ( 1 , "" , $ "AOT compatibility script not found at: { scriptPath } ") ;
118118 }
119119
120120 var workingDirectory = Path . Combine ( repoRoot , "eng" , "scripts" , "compatibility" ) ;
@@ -126,28 +126,28 @@ public async Task<CLICheckResponse> CheckAotCompat(string packagePath, bool fixC
126126 if ( result . ExitCode == 0 )
127127 {
128128 _logger . LogInformation ( "AOT compatibility check completed successfully" ) ;
129- return new CLICheckResponse ( result . ExitCode , result . Output ) ;
129+ return new PackageCheckResponse ( result . ExitCode , result . Output ) ;
130130 }
131131 else
132132 {
133133 _logger . LogWarning ( "AOT compatibility check failed with exit code {ExitCode}" , result . ExitCode ) ;
134- return new CLICheckResponse ( result . ExitCode , result . Output , "AOT compatibility check failed" ) ;
134+ return new PackageCheckResponse ( result . ExitCode , result . Output , "AOT compatibility check failed" ) ;
135135 }
136136 }
137137 catch ( Exception ex )
138138 {
139139 _logger . LogError ( ex , "Error running AOT compatibility check at {PackagePath}" , packagePath ) ;
140- return new CLICheckResponse ( 1 , "" , $ "Error running AOT compatibility check: { ex . Message } ") ;
140+ return new PackageCheckResponse ( 1 , "" , $ "Error running AOT compatibility check: { ex . Message } ") ;
141141 }
142142 }
143143
144- private async ValueTask < CLICheckResponse > VerifyDotnetVersion ( )
144+ private async ValueTask < PackageCheckResponse > VerifyDotnetVersion ( )
145145 {
146146 var dotnetSDKCheck = await _processHelper . Run ( new ProcessOptions ( DotNetCommand , [ "--list-sdks" ] ) , CancellationToken . None ) ;
147147 if ( dotnetSDKCheck . ExitCode != 0 )
148148 {
149149 _logger . LogError ( ".NET SDK is not installed or not available in PATH" ) ;
150- return new CLICheckResponse ( dotnetSDKCheck . ExitCode , $ "dotnet --list-sdks failed with an error: { dotnetSDKCheck . Output } ") ;
150+ return new PackageCheckResponse ( dotnetSDKCheck . ExitCode , $ "dotnet --list-sdks failed with an error: { dotnetSDKCheck . Output } ") ;
151151 }
152152
153153 var dotnetVersions = dotnetSDKCheck . Output . Split ( Environment . NewLine . ToCharArray ( ) , StringSplitOptions . RemoveEmptyEntries ) ;
@@ -159,18 +159,18 @@ private async ValueTask<CLICheckResponse> VerifyDotnetVersion()
159159 if ( installedVersion >= minimumVersion )
160160 {
161161 _logger . LogInformation ( ".NET SDK version {InstalledVersion} meets minimum requirement of {RequiredVersion}" , latestVersionNumber , RequiredDotNetVersion ) ;
162- return new CLICheckResponse ( 0 , $ ".NET SDK version { latestVersionNumber } meets minimum requirement of { RequiredDotNetVersion } ") ;
162+ return new PackageCheckResponse ( 0 , $ ".NET SDK version { latestVersionNumber } meets minimum requirement of { RequiredDotNetVersion } ") ;
163163 }
164164 else
165165 {
166166 _logger . LogError ( ".NET SDK version {InstalledVersion} is below minimum requirement of {RequiredVersion}" , latestVersionNumber , RequiredDotNetVersion ) ;
167- return new CLICheckResponse ( 1 , "" , $ ".NET SDK version { latestVersionNumber } is below minimum requirement of { RequiredDotNetVersion } ") ;
167+ return new PackageCheckResponse ( 1 , "" , $ ".NET SDK version { latestVersionNumber } is below minimum requirement of { RequiredDotNetVersion } ") ;
168168 }
169169 }
170170 else
171171 {
172172 _logger . LogError ( "Failed to parse .NET SDK version: {VersionString}" , latestVersionNumber ) ;
173- return new CLICheckResponse ( 1 , "" , $ "Failed to parse .NET SDK version: { latestVersionNumber } ") ;
173+ return new PackageCheckResponse ( 1 , "" , $ "Failed to parse .NET SDK version: { latestVersionNumber } ") ;
174174 }
175175 }
176176
0 commit comments