Skip to content

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jul 7, 2025

Follow-up to #116941.

  • Format ILCompiler.TrimmingTests
  • Fix ILLink.RoslynAnalyzer generated tests
  • Fix whitespace in comments and #if'd out code
  • Fix whitespace in Roslyn Analyzer test strings
  • Remove suppression for spacing around keywords
  • Update expected warning locations for analyzer tests

sbomer added 2 commits July 2, 2025 17:47
- Format ILCompiler.TrimmingTests
- Fix ILLink.RoslynAnalyzer generated tests
- Fix whitespace in comments and #if'd out code
- Remove suppression for spacing around keywords
@sbomer sbomer requested review from a team and Copilot July 7, 2025 23:27
@sbomer sbomer changed the title Fix formatting in ILLink More ILLink formatting fixes Jul 7, 2025
@github-actions github-actions bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Jul 7, 2025
@dotnet-policy-service dotnet-policy-service bot added the linkable-framework Issues associated with delivering a linker friendly framework label Jul 7, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/illink
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR applies broad formatting clean-ups across ILLink tests and related tooling code, aligning brace placement, using directives, comment whitespace, and editorconfig settings. It also updates expected diagnostic spans in Roslyn analyzer tests and corrects a few test directives.

  • Reordered and grouped using directives for consistency.
  • Standardized brace placement and indentation in methods and properties.
  • Updated expected warning locations in ILLink.RoslynAnalyzer test files.
  • Removed the SA1000 suppression and fixed whitespace in comments and #if directives.

Reviewed Changes

Copilot reviewed 41 out of 302 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tools/illink/test/Mono.Linker.Tests.Cases/Substitutions/FeatureGuardSubstitutionsDisabled.cs Reordered using directives.
src/tools/illink/test/Mono.Linker.Tests.Cases/Substitutions/FeatureGuardSubstitutions.cs Reordered using directives.
src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/ObjectGetType.cs Reordered using directives.
src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/EventHanderTypeGetInvokeMethod.cs Standardized brace placement on overridden properties.
src/tools/illink/test/Mono.Linker.Tests.Cases/Extensibility/CustomStepCanFixAbstractMethods.cs Fixed ordering of using for dependency namespaces.
src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethod.cs Aligned whitespace around object creation and comments.
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs Reordered using directives.
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ByRefDataflow.cs Reordered using directives.
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureGuardAttributeDataFlow.cs Reordered using directives.
src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnReturnTypeIsRemoved.cs Fixed whitespace in #if symbol.
src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/UnconditionalSuppressMessageCodeFixTests.cs Updated diagnostic spans for codefix tests.
src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnreferencedCodeAnalyzerTests.cs Updated diagnostic spans for analyzer tests.
src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresDynamicCodeAnalyzerTests.cs Updated diagnostic spans for analyzer tests.
src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresAssemblyFilesAnalyzerTests.cs Updated diagnostic spans for analyzer tests.
src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DynamicallyAccessedMembersCodeFixTests.cs Updated diagnostic spans for codefix tests.
src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DynamicallyAccessedMembersAnalyzerTests.cs Updated diagnostic spans and fixed a malformed instantiation.
src/tools/illink/src/linker/Linker/TypeNameResolver.cs Removed duplicate using.
src/tools/illink/src/ILLink.Shared/TrimAnalysis/Intrinsics.cs Cleaned up comment prefixes.
src/tools/illink/external/Mono.Options/Options.cs Reformatted class and method declarations to match style guide.
src/tools/illink/.editorconfig Removed the suppression for SA1000 (spacing around keywords).
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/Tests/DocumentationSignatureParserTests.cs Adjusted brace placement in tests.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingTestLogger.cs Standardized brace placement in lock statements.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingDriver.cs Standardized brace placement in loops and conditionals.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs Standardized brace placement in conditionals and loops.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestRunner.cs Standardized brace placement around try/catch.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestInfraMultiFileCompilationModuleGroup.cs Standardized brace placement in if statements.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseMetadataProvider.cs Standardized brace placement and grouping of using.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompiler.cs Standardized brace placement in method bodies.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCollector.cs Standardized brace placement in loops and conditionals.
Comments suppressed due to low confidence (3)

src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethod.cs:198

  • The instantiation syntax is malformed. It should be new Impl() with matching parentheses, e.g. var i = new Impl();.
            var i = new Impl ); // Avoid removal of non-implemented abstract methods

src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnReturnTypeIsRemoved.cs:16

  • The feature symbol is misspelled (IL_ASSEMBLY_AVAIABLE). It should read IL_ASSEMBLY_AVAILABLE to match the intended conditional compilation symbol.
#if IL_ASSEMBLY_AVAIABLE

src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DynamicallyAccessedMembersAnalyzerTests.cs:1415

  • The object creation is missing its constructor invocation parentheses. It should be new CRequires<TOuter>() instead of new CRequires<TOuter>);.
                static CRequires<TOuter> Value => new CRequires<TOuter>);

sbomer and others added 3 commits July 8, 2025 08:04
@sbomer sbomer requested a review from MichalStrehovsky as a code owner July 9, 2025 20:35
@sbomer sbomer merged commit 33f2533 into dotnet:main Jul 10, 2025
111 of 116 checks passed
@sbomer sbomer deleted the illinkFormat branch July 21, 2025 23:09
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants