Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MA0048 in case when first type is not first node #785

Merged

Conversation

FrediKats
Copy link
Contributor

Option "only_validate_first_type" now works more like "only_validate_first_node".

foreach (var node in root.DescendantNodesAndSelf(descendIntoChildren: node => !IsTypeDeclaration(node)))

This block of code returns CompilationUnit and if (node.SpanStart < symbolNode.SpanStart) always works as if (0 < symbolNode.SpanStart).

PR contains:

  • test to confirm this problem (namespace before type).
  • fix with comparing only with other type declarations (skip nodes that is not type declaration)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@meziantou meziantou merged commit 7e57a0b into meziantou:main Feb 9, 2025
17 of 18 checks passed
@meziantou
Copy link
Owner

Thanks for your contribution 🚀

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.

None yet

2 participants