-
Notifications
You must be signed in to change notification settings - Fork 9
Feature/atr 728 dev graph declaration diagnostic #621
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
Feature/atr 728 dev graph declaration diagnostic #621
Conversation
…e abstract modifier
|
|
||
| ## Summary | ||
|
|
||
| | Code | Short Description | Type | Code Fix | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EAndrosova please review
There was a problem hiding this 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 introduces a new diagnostic PX1112 that enforces that graphs and graph extensions with generic type parameters must be declared as abstract. This prevents improper instantiation of generic graphs/extensions in the Acumatica Framework and ensures correct inheritance patterns. The implementation includes the analyzer, code fix, comprehensive tests, and documentation.
Key changes:
- Added diagnostic PX1112 to detect non-abstract generic graphs and graph extensions
- Implemented code fix to add
abstractmodifier and removesealedmodifier when needed - Added comprehensive test coverage for various scenarios including partial types
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| GraphAndGraphExtensionDeclarationAnalyzer.cs | New analyzer that detects generic graphs/extensions missing abstract modifier |
| TypeModifiersFix.cs | Code fix implementation to add abstract and remove sealed modifiers |
| PXGraphAnalyzer.cs | Registered the new declaration analyzer |
| Descriptors.cs | Added PX1112 diagnostic descriptor |
| Resources.resx | Added diagnostic title and code fix message |
| DiagnosticsShortName.resx | Added short name for PX1112 |
| GenericNonAbstractGraphsAndGraphExtensionsTests.cs | Test suite covering diagnostic and code fix scenarios |
| Various test source files | Test input and expected output files |
| PX1112.md | Documentation for the diagnostic |
| Summary.md | Added PX1112 to diagnostics summary table |
Files not reviewed (2)
- src/Acuminator/Acuminator.Analyzers/DiagnosticsShortName.Designer.cs: Language not supported
- src/Acuminator/Acuminator.Analyzers/Resources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...s/StaticAnalysis/DeclarationAnalysisGraphAndDac/GraphAndGraphExtensionDeclarationAnalyzer.cs
Outdated
Show resolved
Hide resolved
| | [PX1102](diagnostics/PX1102.md) | The additional delegate parameter of the method with the `PXOverride` attribute must have a name conforming Acumatica naming conventions. | Warning | Available | | ||
| | [PX1110](diagnostics/PX1110.md) | The DAC has a DAC field with the `PXDBLocalizableString` attribute. Therefore, this DAC must declare a `NoteID` DAC field. | Error | Available | | ||
| | [PX1111](diagnostics/PX1111.md) | The primary DAC of a processing view must contain the `NoteID` field. | Error | Unavailable | | ||
| | [PX1112](diagnostics/PX1112.md) | Graphs and graph extensions with generic type parameters must be abstract. | Error | Available | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EAndrosova please review
| <data name="PX1111TitleFormat" xml:space="preserve"> | ||
| <value>The primary DAC "{0}" of the processing view "{1}" must contain the "NoteID" field</value> | ||
| </data> | ||
| <data name="PX1112Fix" xml:space="preserve"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EAndrosova please review
| <data name="PX1111" xml:space="preserve"> | ||
| <value>MainDacOfProcessingViewMustContainNoteIdField</value> | ||
| </data> | ||
| <data name="PX1112" xml:space="preserve"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EAndrosova please review
|
The documentation review will be done in a separate PR |
Implemented diagnostic PX1112 to report generic non-abstract graphs and graph extensions.
Changes Overview