diff --git a/data/reusables/actions/azure-vnet-supported-regions.md b/data/reusables/actions/azure-vnet-supported-regions.md index cf13ff07ff3f..a4b1b5284901 100644 --- a/data/reusables/actions/azure-vnet-supported-regions.md +++ b/data/reusables/actions/azure-vnet-supported-regions.md @@ -27,4 +27,15 @@ Azure private networking supports GPU runners in the following regions. - `NorthCentralUs` - `SouthCentralUs` +Azure private networking supports arm64 runners in the following regions. + +- `EastUs` +- `EastUs2` +- `WestUs2` +- `NorthCentralUs` +- `SouthCentralUs` + +> [!NOTE] +> GPU and arm64 runners are currently in beta and subject to change. + If your desired region is not supported, please submit a request for new region availability in [this GitHub form](https://resources.github.com/private-networking-for-github-hosted-runners-with-azure-virtual-networks/). You may also use global virtual network peering to connect virtual networks across Azure regions. For more information, see [Virtual network peering](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-peering-overview) in the Azure documentation. diff --git a/src/content-linter/README.md b/src/content-linter/README.md index 73c43366f3f7..acd88652f2ca 100644 --- a/src/content-linter/README.md +++ b/src/content-linter/README.md @@ -219,3 +219,18 @@ The downside to using the `search-replace` plugin is that you cannot disable eac ```markdown docs.github.com ``` + +## Adding context to a base rule's error message + +If you want to add context to a base rule's error message, go to[`base.js`](/src/content-linter/style/base.js), and add the `context` property to the base rule's object. For e.g. if you wanted to add `context` to `MD040` (the `fenced-code-language` base rule), the object would look like this: + +```javascript +'fenced-code-language': { + // MD040 + severity: 'error', + 'partial-markdown-files': true, + 'yml-files': true, + allowed_languages: allowedCodeFenceLanguages, + context: `When you add a fenced code block, you must specify the code language. Allowed languages are: ${allowedCodeFenceLanguages.join(', ')}. You can add allowed languages by updating data/code-languages.yml.`, + }, +``` diff --git a/src/content-linter/lib/helpers/print-annotations.js b/src/content-linter/lib/helpers/print-annotations.js index 1214d3c6b3b0..08e1c8fca5fa 100644 --- a/src/content-linter/lib/helpers/print-annotations.js +++ b/src/content-linter/lib/helpers/print-annotations.js @@ -35,7 +35,13 @@ export function printAnnotationResults( annotation += `${bits.join(',')}` if (flaw.errorDetail) { - annotation += `::${flaw.errorDetail}` + annotation += flaw.errorDetail.endsWith('.') + ? `::${flaw.errorDetail}` + : `::${flaw.errorDetail}.` + } + + if (flaw.context) { + annotation += ` ${flaw.context}` } // Why console.log and not `core.error()` (from @actions/core)? diff --git a/src/content-linter/scripts/lint-content.js b/src/content-linter/scripts/lint-content.js index ca2d36c9799d..63b9ae2ba480 100755 --- a/src/content-linter/scripts/lint-content.js +++ b/src/content-linter/scripts/lint-content.js @@ -474,6 +474,8 @@ function formatResult(object, isPrecommit) { formattedResult.severity = allConfig[ruleName].severity || getSearchReplaceRuleSeverity(ruleName, object, isPrecommit) + formattedResult.context = allConfig[ruleName].context || '' + return Object.entries(object).reduce((acc, [key, value]) => { if (key === 'fixInfo') { acc.fixable = !!value diff --git a/src/content-linter/scripts/pretty-print-results.js b/src/content-linter/scripts/pretty-print-results.js index 77f586b7b02e..2d2147c885b5 100644 --- a/src/content-linter/scripts/pretty-print-results.js +++ b/src/content-linter/scripts/pretty-print-results.js @@ -81,6 +81,13 @@ export function prettyPrintResults(results, { fixed = false } = {}) { `${indentWrappedString(result.errorDetail?.replace(/\n/g, ' ').trim(), PREFIX_PADDING.length * 8)}`, ) } + + if (result.context) { + console.log( + label('Context'), + `${indentWrappedString(result.context.replace(/\n/g, ' ').trim(), PREFIX_PADDING.length * 8)}`, + ) + } } let position = chalk.yellow(result.lineNumber) if (isNumber(result.columnNumber) && result.columnNumber !== 1) { diff --git a/src/content-linter/style/base.js b/src/content-linter/style/base.js index 4515bd8cf1e4..01f3e0bc12ec 100644 --- a/src/content-linter/style/base.js +++ b/src/content-linter/style/base.js @@ -120,6 +120,7 @@ export const baseConfig = { 'partial-markdown-files': true, 'yml-files': true, allowed_languages: allowedCodeFenceLanguages, + context: `When you add a fenced code block, you must specify the code language. Allowed languages are: ${allowedCodeFenceLanguages.join(', ')}. You can add allowed languages by updating data/code-languages.yml.`, }, 'no-empty-links': { // MD042 diff --git a/src/content-linter/types.ts b/src/content-linter/types.ts index 894e86915016..5deac218a82b 100644 --- a/src/content-linter/types.ts +++ b/src/content-linter/types.ts @@ -22,6 +22,7 @@ export type Config = { allowed_languages?: string[] style?: string rules?: RuleDetail[] + context?: string } export type RuleConfig = {