Skip to content

Commit c95f90f

Browse files
authored
Merge pull request #39077 from github/repo-sync
Repo sync
2 parents fbb81d5 + 0668e08 commit c95f90f

File tree

25 files changed

+632
-1376
lines changed

25 files changed

+632
-1376
lines changed

content/copilot/tutorials/enhancing-copilot-agent-mode-with-mcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Enhancing Copilot agent mode with MCP
33
allowTitleToDifferFromFilename: true
44
shortTitle: Enhance agent mode with MCP
5-
intro: "Learn how to use the Model Context Protocol (MCP) to expand {% data variables.copilot.copilot_chat_short %}''s agentic capabilities."
5+
intro: "Learn how to use the Model Context Protocol (MCP) to expand the agentic capabilities of {% data variables.copilot.copilot_chat_short %}."
66
versions:
77
feature: copilot
88
topics:

data/reusables/actions/about-larger-runners.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Customers on {% data variables.product.prodname_team %} and {% data variables.product.prodname_ghe_cloud %} plans can choose from a range of managed virtual machines that have more resources than the [standard {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources). These machines are referred to as "{% data variables.actions.hosted_runner %}." They offer the following advanced features:
1+
Customers on {% data variables.product.prodname_team %} and {% data variables.product.prodname_ghe_cloud %} plans can choose from a range of managed virtual machines that have more resources than the [standard {% data variables.product.prodname_dotcom %}-hosted runners](/actions/how-tos/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources). These machines are referred to as "{% data variables.actions.hosted_runner %}." They offer the following advanced features:
22

33
* More RAM, CPU, and disk space
44
* Static IP addresses

data/reusables/contributing/content-linter-rules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
| GHD011 | frontmatter-video-transcripts | Video transcript must be configured correctly | error | frontmatter, feature, video-transcripts |
5454
| GHD012 | frontmatter-schema | Frontmatter must conform to the schema | error | frontmatter, schema |
5555
| GHD007 | code-annotations | Code annotations defined in Markdown must contain a specific layout frontmatter property | error | code, feature, annotate, frontmatter |
56+
| GHD045 | code-annotation-comment-spacing | Code comments in annotation blocks must have exactly one space after the comment character(s) | warning | code, comments, annotate, spacing |
5657
| GHD017 | frontmatter-liquid-syntax | Frontmatter properties must use valid Liquid | error | liquid, frontmatter |
5758
| GHD018 | liquid-syntax | Markdown content must use valid Liquid | error | liquid |
5859
| GHD019 | liquid-if-tags | Liquid `ifversion` tags should be used instead of `if` tags when the argument is a valid version | error | liquid, versioning |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% data variables.copilot.copilot_coding_agent %} is available with the {% data variables.copilot.copilot_pro %}, {% data variables.copilot.copilot_pro_plus %}, {% data variables.copilot.copilot_for_business %} and {% data variables.copilot.copilot_enterprise %} plans in repositories where it has not been disabled. {% data variables.copilot.copilot_coding_agent %} is not available in repositories owned by {% data variables.enterprise.prodname_managed_users %}.
1+
{% data variables.copilot.copilot_coding_agent %} is available with the {% data variables.copilot.copilot_pro %}, {% data variables.copilot.copilot_pro_plus %}, {% data variables.copilot.copilot_for_business %} and {% data variables.copilot.copilot_enterprise %} plans. Access for {% data variables.product.prodname_copilot_short %} trials is coming soon. The agent is available in all repositories, except where it has been explicitly disabled and repositories owned by {% data variables.enterprise.prodname_managed_users %}.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { addError, filterTokens } from 'markdownlint-rule-helpers'
2+
3+
export const codeAnnotationCommentSpacing = {
4+
names: ['GHD045', 'code-annotation-comment-spacing'],
5+
description:
6+
'Code comments in annotation blocks must have exactly one space after the comment character(s)',
7+
tags: ['code', 'comments', 'annotate', 'spacing'],
8+
parser: 'markdownit',
9+
function: (params, onError) => {
10+
filterTokens(params, 'fence', (token) => {
11+
if (!token.info.includes('annotate')) return
12+
13+
const lines = token.content.split('\n')
14+
15+
lines.forEach((line, index) => {
16+
const trimmedLine = line.trim()
17+
if (!trimmedLine) return
18+
19+
// Define a map of comment patterns
20+
const commentPatterns = {
21+
'//': /^(\/\/)(.*)/, // JavaScript/TypeScript/Java/C# style comments
22+
'#': /^(#)(.*)/, // Python/Ruby/Shell/YAML style comments
23+
'--': /^(--)(.*)/, // SQL/Lua style comments
24+
}
25+
26+
// Check for different comment patterns
27+
let commentMatch = null
28+
let commentChar = null
29+
let restOfLine = null
30+
31+
// Iterate over the map to find a matching comment style
32+
for (const [char, pattern] of Object.entries(commentPatterns)) {
33+
if (trimmedLine.startsWith(char)) {
34+
commentMatch = trimmedLine.match(pattern)
35+
commentChar = char
36+
restOfLine = commentMatch ? commentMatch[2] : ''
37+
break
38+
}
39+
}
40+
41+
if (commentMatch && restOfLine !== null) {
42+
// Skip shebang lines (#!/...)
43+
if (trimmedLine.startsWith('#!')) {
44+
return
45+
}
46+
47+
// Allow empty comments or comments with exactly one space
48+
if (restOfLine === '' || restOfLine.startsWith(' ')) {
49+
// If it starts with a space, make sure it's exactly one space
50+
if (restOfLine.startsWith(' ') && restOfLine.length > 1 && restOfLine[1] === ' ') {
51+
// Multiple spaces - this is an error
52+
const lineNumber = token.lineNumber + index + 1
53+
const fixedLine = line.replace(
54+
new RegExp(`^(\\s*${commentChar.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})\\s+`),
55+
`$1 `,
56+
)
57+
58+
addError(
59+
onError,
60+
lineNumber,
61+
`Comment must have exactly one space after '${commentChar}', found multiple spaces`,
62+
line,
63+
[1, line.length],
64+
{
65+
lineNumber,
66+
editColumn: 1,
67+
deleteCount: line.length,
68+
insertText: fixedLine,
69+
},
70+
)
71+
}
72+
// Single space or empty - this is correct
73+
return
74+
} else {
75+
// No space after comment character - this is an error
76+
const lineNumber = token.lineNumber + index + 1
77+
const leadingWhitespace = line.match(/^\s*/)[0]
78+
const fixedLine = leadingWhitespace + commentChar + ' ' + restOfLine
79+
80+
addError(
81+
onError,
82+
lineNumber,
83+
`Comment must have exactly one space after '${commentChar}'`,
84+
line,
85+
[1, line.length],
86+
{
87+
lineNumber,
88+
editColumn: 1,
89+
deleteCount: line.length,
90+
insertText: fixedLine,
91+
},
92+
)
93+
}
94+
}
95+
})
96+
})
97+
},
98+
}

src/content-linter/lib/linting-rules/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { liquidQuotedConditionalArg } from './liquid-quoted-conditional-arg.js'
2424
import { liquidDataReferencesDefined, liquidDataTagFormat } from './liquid-data-tags.js'
2525
import { frontmatterSchema } from './frontmatter-schema.js'
2626
import { codeAnnotations } from './code-annotations.js'
27+
import { codeAnnotationCommentSpacing } from './code-annotation-comment-spacing.js'
2728
import { frontmatterLiquidSyntax, liquidSyntax } from './liquid-syntax.js'
2829
import { liquidIfTags, liquidIfVersionTags } from './liquid-versioning.js'
2930
import { raiReusableUsage } from './rai-reusable-usage.js'
@@ -73,6 +74,7 @@ export const gitHubDocsMarkdownlint = {
7374
frontmatterVideoTranscripts,
7475
frontmatterSchema,
7576
codeAnnotations,
77+
codeAnnotationCommentSpacing,
7678
frontmatterLiquidSyntax,
7779
liquidSyntax,
7880
liquidIfTags,

src/content-linter/style/github-docs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ const githubDocsConfig = {
180180
'partial-markdown-files': true,
181181
'yml-files': true,
182182
},
183+
'code-annotation-comment-spacing': {
184+
// GHD045
185+
severity: 'warning',
186+
'partial-markdown-files': true,
187+
'yml-files': true,
188+
},
183189
'british-english-quotes': {
184190
// GHD048
185191
severity: 'warning',

0 commit comments

Comments
 (0)