Repository navigation
fix(DC0007,DC0008): require documentation on extension objects - #629
Merged
Merged
Conversation
ObjectRequiresDocumentation registered only the base object kinds, so undocumented tableextension, pageextension, reportextension, enumextension, permissionsetextension, profileextension and pagecustomization objects were never reported. Register those seven symbol kinds as well. Every extension and customization symbol derives from ObjectTypeSymbol, so it passes the existing IObjectTypeSymbol gate unchanged. Its DeclaredAccessibility reads the Access property with a Public default; AL gives extension objects no Access property, so they always count as public and raise DC0007, never DC0008. IsTestCodeunit() returns false for them because they are not codeunit symbols. Fixtures declare the targets in the same file (gated on SDK 13.0; profileextension also on 14.0), and an InternalNoDiagnostic case pins that undocumented extensions never raise DC0008. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ObjectRequiresDocumentationnow also registersTableExtension,PageExtension,ReportExtension,EnumExtension,PermissionSetExtension,ProfileExtensionandPageCustomization. Before, undocumented extension objects were never reported.PublicHasDiagnostic/UndocumentedExtensions.alandPublicNoDiagnostic/DocumentedExtensions.al(five extension kinds with same-file targets, gated on SDK 13.0); separate profileextension fixtures (13.0 + 14.0,Feature.ProfileExtensionsneeds runtime Fall2024) and pagecustomization fixtures (13.0);InternalNoDiagnostic/UndocumentedExtensions.alpins that DC0008 never fires on extensions. The new HasDiagnostic cases failed with "no issue reported" before the analyzer change.Closes #622
Accessibility finding
Every extension and customization symbol derives from
ApplicationObjectTypeSymbol : ObjectTypeSymbol, so it passes the existingIObjectTypeSymbolgate without changes.ObjectTypeSymbol.DeclaredAccessibilityreadsAccesswith a Public default, and AL gives extension objects noAccessproperty, so they always count as public: only DC0007 fires.IsTestCodeunit()returns false for them (notICodeunitTypeSymbol).This is a deliberate behaviour change: DC0007 is enabled by default, so apps with undocumented extension objects get new DC0007 diagnostics after upgrading.
Docs: ALCops/alcops.dev#220
Review
One
/code-review highround; no code changes needed. Findings justified, none open:ProfileExtensionsentinel on old SDKs: not applicable;EnumProviderresolves it with a plainParse(present at the 12.0 floor) and LC0092 already registers it.SkipTestIfVersionIsTooLowlists: kept in the same shape asNamingPattern.cs.🤖 Generated with Claude Code