From 238ef30cb35851fc761601aad24a3018494e1f6c Mon Sep 17 00:00:00 2001 From: Tom Kroes <128816552+tkroes@users.noreply.github.com> Date: Fri, 27 Nov 2026 13:15:03 +0100 Subject: [PATCH 1/2] docs(AC0037): document app manifest publisher checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../docs/analyzers/ApplicationCop/AC0037.md | 51 +++++++++++++++++++ .../docs/analyzers/ApplicationCop/_index.md | 1 + content/docs/getting-started/configuration.md | 36 +++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 content/docs/analyzers/ApplicationCop/AC0037.md diff --git a/content/docs/analyzers/ApplicationCop/AC0037.md b/content/docs/analyzers/ApplicationCop/AC0037.md new file mode 100644 index 0000000..2f345c0 --- /dev/null +++ b/content/docs/analyzers/ApplicationCop/AC0037.md @@ -0,0 +1,51 @@ ++++ +title = 'Use the configured app.json publisher pattern' +linkTitle = 'AC0037' + +[params] + id = 'AC0037' + severity = 'Info' + category = 'Design' + codeAction = false + ignoreObsolete = true ++++ + +AC0037 checks the app's `publisher` against a configured regular-expression convention. It is disabled by default because publisher naming is an organization-specific convention. + +### Configure the pattern + +Add an `AllowPattern`, a `DisallowPattern`, or both under `Manifest.Publisher` in `alcops.json`: + +{{< highlight json >}} +{ + "Manifest": { + "Publisher": { + "AllowPattern": "^Contoso Ltd\\.$" + } + } +} +{{< /highlight >}} + +Patterns use .NET regular-expression syntax. `AllowPattern` requires a match; `DisallowPattern` reports a match. Anchor patterns with `^` and `$` when the entire publisher value must match. + +The rule does not check for a missing publisher when no pattern is configured. `publisher` is a required app manifest property, so manifest validation already handles its absence. + +### Enable the rule + +Add AC0037 to the project's `.ruleset.json`: + +{{< highlight json >}} +{ + "name": "My Project Ruleset", + "rules": [ + { + "id": "AC0037", + "action": "Info" + } + ] +} +{{< /highlight >}} + +### When the diagnostic is reported + +AC0037 reports on `publisher` when a configured pattern is invalid or times out, the value does not match `AllowPattern`, or it matches `DisallowPattern`. No diagnostic is reported when neither pattern is configured. diff --git a/content/docs/analyzers/ApplicationCop/_index.md b/content/docs/analyzers/ApplicationCop/_index.md index f47c727..d6191c8 100644 --- a/content/docs/analyzers/ApplicationCop/_index.md +++ b/content/docs/analyzers/ApplicationCop/_index.md @@ -46,5 +46,6 @@ ApplicationCop inspects how objects are modeled: tables, fields, pages, enums, l | [AC0034](ac0034/) | Register a Telemetry Logger in this app | Info | — | | | [AC0035](ac0035/) | Rest Client is not initialized with a custom Http Client Handler | Warning | ✓ | | | [AC0036](ac0036/) | Action property duplicates the value of its RunObject target | Info | ✓ | | +| [AC0037](ac0037/) | Use the configured app.json publisher pattern | Info | — | | **Note:** Rules marked with "—" in the Enabled column are disabled by default and must be explicitly enabled in your project's ruleset file. diff --git a/content/docs/getting-started/configuration.md b/content/docs/getting-started/configuration.md index 8ce2d33..dc9cb8f 100644 --- a/content/docs/getting-started/configuration.md +++ b/content/docs/getting-started/configuration.md @@ -29,6 +29,7 @@ The `alcops.json` file provides analyzer-specific configuration. Place it in the | `MaintainabilityIndexThreshold` | integer | `20` | Minimum maintainability index before a diagnostic is reported | | `LanguagesToTranslate` | string[] | `null` | Language codes to check for missing translations | | `NamingPatterns` | object | `null` | Per-target naming pattern overrides | +| `Manifest` | object | `{}` | Opt-in ApplicationCop checks for app.json conventions; all six related rules are disabled by default | | `UseSequentialGuidScope` | string | `null` | Set to `"AllGuidFields"` to require sequential GUIDs on all GUID fields | Property names are case-insensitive. Comments and trailing commas are allowed. An empty, whitespace-only, comment-only or JSON-null local file uses defaults without CM0001. A declared inherited configuration must still contain a JSON object. @@ -145,6 +146,41 @@ Specify which language codes must have translations present in the `.xlf` files. } ``` +### Manifest + +The `Manifest` object configures opt-in ApplicationCop checks for `app.json`. Each rule must also be enabled in the project's `.ruleset.json`; all six are disabled by default. + +```json +{ + "Manifest": { + "Publisher": { + "AllowPattern": "^Contoso Ltd\\.$" + }, + "ContextSensitiveHelpUrl": { + "AllowPattern": "^https://help\\.contoso\\.example/.+$" + }, + "ResourceExposurePolicy": { + "AllowDebugging": false, + "AllowDownloadingSource": false + }, + "RequiredFeatures": ["NoImplicitWith", "TranslationFile"], + "DisallowSuppressWarnings": true, + "VersionMajorMatchesApplication": true + } +} +``` + +`Publisher` and `ContextSensitiveHelpUrl` accept `AllowPattern` and `DisallowPattern` regular expressions. `ResourceExposurePolicy` compares only the boolean flags you configure. `RequiredFeatures` lists compiler feature names from the app manifest; a feature unknown to the compiler version being used is ignored. `DisallowSuppressWarnings` and `VersionMajorMatchesApplication` default to `false`. + +| Rule | Manifest property | +|------|-------------------| +| [AC0037](../analyzers/applicationcop/ac0037/) | `publisher` | +| [AC0038](../analyzers/applicationcop/ac0038/) | `contextSensitiveHelpUrl` | +| [AC0039](../analyzers/applicationcop/ac0039/) | `resourceExposurePolicy` | +| [AC0040](../analyzers/applicationcop/ac0040/) | `features` | +| [AC0041](../analyzers/applicationcop/ac0041/) | `suppressWarnings` | +| [AC0042](../analyzers/applicationcop/ac0042/) | `version` / `application` | + {{% alert title="Note" %}} The `alcops.json` file is read when the analyzer loads. In VS Code, changes to this file require reloading the window (`Ctrl+Shift+P` → **Developer: Reload Window**) to take effect. {{% /alert %}} From 29e9248b844fb0799db65ca626c477b50b68ef7a Mon Sep 17 00:00:00 2001 From: Tom Kroes <128816552+tkroes@users.noreply.github.com> Date: Fri, 27 Nov 2026 13:26:03 +0100 Subject: [PATCH 2/2] Fix manifest rule documentation links Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- content/docs/getting-started/configuration.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/content/docs/getting-started/configuration.md b/content/docs/getting-started/configuration.md index dc9cb8f..44a8d6e 100644 --- a/content/docs/getting-started/configuration.md +++ b/content/docs/getting-started/configuration.md @@ -174,12 +174,7 @@ The `Manifest` object configures opt-in ApplicationCop checks for `app.json`. Ea | Rule | Manifest property | |------|-------------------| -| [AC0037](../analyzers/applicationcop/ac0037/) | `publisher` | -| [AC0038](../analyzers/applicationcop/ac0038/) | `contextSensitiveHelpUrl` | -| [AC0039](../analyzers/applicationcop/ac0039/) | `resourceExposurePolicy` | -| [AC0040](../analyzers/applicationcop/ac0040/) | `features` | -| [AC0041](../analyzers/applicationcop/ac0041/) | `suppressWarnings` | -| [AC0042](../analyzers/applicationcop/ac0042/) | `version` / `application` | +| [AC0037](../../analyzers/applicationcop/ac0037/) | `publisher` | {{% alert title="Note" %}} The `alcops.json` file is read when the analyzer loads. In VS Code, changes to this file require reloading the window (`Ctrl+Shift+P` → **Developer: Reload Window**) to take effect.