Skip to content

Add code fixer for MA0137 and MA0138 (async suffix naming)#1068

Merged
meziantou merged 4 commits intomainfrom
copilot/add-fixer-for-ma0137-and-ma0138
Mar 30, 2026
Merged

Add code fixer for MA0137 and MA0138 (async suffix naming)#1068
meziantou merged 4 commits intomainfrom
copilot/add-fixer-for-ma0137-and-ma0138

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

  • Create MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixFixer.cs that handles MA0137 and MA0138 using Renamer.RenameSymbolAsync
  • Add code fix tests to MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs:
    • AsyncMethodWithoutSuffix_CodeFix_AddsAsyncSuffix (MA0137 regular method)
    • MethodNotReturningAwaitableTypeWithSuffix_CodeFix_RemovesAsyncSuffix (MA0138 regular method)
    • VoidLocalFunctionWithSuffix_CodeFix_RemovesAsyncSuffix (MA0138 local function)
  • Run dotnet run --project src/DocumentationGenerator to update markdown docs
  • Merge conflicts resolved with origin/main (MA0137 exclude_test_methods config option + new tests)
  • All 18 tests pass

Copilot AI changed the title [WIP] Add fixer for MA0137 and MA0138 using SymbolRenamer Add code fixer for MA0137 and MA0138 (async suffix naming) Mar 30, 2026
Copilot AI requested a review from meziantou March 30, 2026 14:18
Copy link
Copy Markdown
Owner

@meziantou meziantou left a comment

Choose a reason for hiding this comment

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

@copilot There is no tests for one of the analyzer MethodsNotReturningAnAwaitableTypeMustNotHaveTheAsyncSuffix

@meziantou
Copy link
Copy Markdown
Owner

@copilot There are merge conflict, can you resolve them?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 30, 2026

@copilot There is no tests for one of the analyzer MethodsNotReturningAnAwaitableTypeMustNotHaveTheAsyncSuffix

Added VoidLocalFunctionWithSuffix_CodeFix_RemovesAsyncSuffix test covering the MA0138 local function code fix case in commit 772f415.

…e_test_methods config

Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 30, 2026

@copilot There are merge conflict, can you resolve them?

Merge conflicts resolved in 61ef050. The conflict in the test file was resolved by keeping both my code fix tests and the new exclude_test_methods configuration tests from main. All 18 tests pass.

This was referenced Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants