Skip to content

fix(DC0007,DC0008): require documentation on extension objects - #629

Merged
Arthurvdv merged 1 commit into
mainfrom
fix/dc0007-extension-objects
Nov 15, 2026
Merged

Arthurvdv merged 1 commit into
mainfrom
fix/dc0007-extension-objects

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

  • ObjectRequiresDocumentation now also registers TableExtension, PageExtension, ReportExtension, EnumExtension, PermissionSetExtension, ProfileExtension and PageCustomization. Before, undocumented extension objects were never reported.
  • Fixtures: PublicHasDiagnostic/UndocumentedExtensions.al and PublicNoDiagnostic/DocumentedExtensions.al (five extension kinds with same-file targets, gated on SDK 13.0); separate profileextension fixtures (13.0 + 14.0, Feature.ProfileExtensions needs runtime Fall2024) and pagecustomization fixtures (13.0); InternalNoDiagnostic/UndocumentedExtensions.al pins that DC0008 never fires on extensions. The new HasDiagnostic cases failed with "no issue reported" before the analyzer change.
  • Rule doc: registration list, design decision, SDK fact, test notes; also removed the stray blank line that split the Design-decisions table.

Closes #622

Accessibility finding

Every extension and customization symbol derives from ApplicationObjectTypeSymbol : ObjectTypeSymbol, so it passes the existing IObjectTypeSymbol gate without changes. ObjectTypeSymbol.DeclaredAccessibility reads Access with a Public default, and AL gives extension objects no Access property, so they always count as public: only DC0007 fires. IsTestCodeunit() returns false for them (not ICodeunitTypeSymbol).

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 high round; no code changes needed. Findings justified, none open:

  • Default-on DC0007 now reports extensions: the approved policy change, called out above for the release notes.
  • ProfileExtension sentinel on old SDKs: not applicable; EnumProvider resolves it with a plain Parse (present at the 12.0 floor) and LC0092 already registers it.
  • Duplicated SkipTestIfVersionIsTooLow lists: kept in the same shape as NamingPattern.cs.
  • No obsolete-extension / trivia-only fixture: both exemptions are kind-independent and already covered by the existing fixtures.

🤖 Generated with Claude Code

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>
@Arthurvdv
Arthurvdv merged commit 30cdac5 into main Nov 15, 2026
53 checks passed
@Arthurvdv
Arthurvdv deleted the fix/dc0007-extension-objects branch November 15, 2026 17:26
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.

DC0007/DC0008: extension objects are not required to carry XML documentation

1 participant