Skip to content

Commit a6b43f0

Browse files
authored
Merge pull request #39379 from github/repo-sync
Repo sync
2 parents 075adbe + 10a2574 commit a6b43f0

File tree

5 files changed

+122
-79
lines changed

5 files changed

+122
-79
lines changed

content/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ Examples of how to configure access to the private registries supported by {% da
160160
* [`cargo-registry`](#cargo-registry)
161161
* [`composer-repository`](#composer-repository)
162162
* [`docker-registry`](#docker-registry)
163-
* [`git`](#git){% ifversion dependabot-helm-support %}
164-
* [`helm-registry`](#helm-registry){% endif %}
163+
* [`git`](#git)
165164
* [`hex-organization`](#hex-organization)
166165
* [`hex-repository`](#hex-repository)
167166
* [`maven-repository`](#maven-repository)

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,55 @@
2323
| [MD047](https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md) | single-trailing-newline | Files should end with a single newline character | error | blank_lines |
2424
| [MD049](https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md) | emphasis-style | Emphasis style | error | emphasis |
2525
| [MD050](https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md) | strong-style | Strong style | error | emphasis |
26-
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | todocs-placeholder | Catch occurrences of TODOCS placeholder. | error | |
27-
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | docs-domain | Catch occurrences of docs.github.com domain. | error | |
28-
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | help-domain | Catch occurrences of help.github.com domain. | error | |
29-
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | developer-domain | Catch occurrences of developer.github.com domain. | error | |
30-
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: site.data | Catch occurrences of deprecated liquid data syntax. | error | |
31-
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: octicon-<icon-name> | The octicon liquid syntax used is deprecated. Use this format instead `octicon "<octicon-name>" aria-label="<Octicon aria label>"` | error | |
3226
| [GH001](https://github.com/github/markdownlint-github/blob/main/docs/rules/GH001-no-default-alt-text.md) | no-default-alt-text | Images should have meaningful alternative text (alt text) | error | accessibility, images |
3327
| [GH002](https://github.com/github/markdownlint-github/blob/main/docs/rules/GH002-no-generic-link-text.md) | no-generic-link-text | Avoid using generic link text like `Learn more` or `Click here` | error | accessibility, links |
34-
| GHD030 | code-fence-line-length | Code fence lines should not exceed a maximum length | warning | code, accessibility |
35-
| GHD032 | image-alt-text-end-punctuation | Alternate text for images should end with punctuation | error | accessibility, images |
36-
| GHD004 | image-file-kebab-case | Image file names must use kebab-case | error | images |
37-
| GHD033 | incorrect-alt-text-length | Images alternate text should be between 40-150 characters | warning | accessibility, images |
28+
| GHD001 | link-punctuation | Internal link titles must not contain punctuation | error | links, url |
3829
| GHD002 | internal-links-no-lang | Internal links must not have a hardcoded language code | error | links, url |
3930
| GHD003 | internal-links-slash | Internal links must start with a / | error | links, url |
40-
| GHD031 | image-alt-text-exclude-words | Alternate text for images should not begin with words like "image" or "graphic" | error | accessibility, images |
41-
| GHD034 | list-first-word-capitalization | First word of list item should be capitalized | warning | ul, ol |
42-
| GHD001 | link-punctuation | Internal link titles must not contain punctuation | error | links, url |
43-
| GHD008 | early-access-references | Files that are not early access should not reference early-access or early-access files | error | feature, early-access |
44-
| GHD021 | yaml-scheduled-jobs | YAML snippets that include scheduled workflows must not run on the hour and must be unique | error | feature, actions |
45-
| GHD006 | internal-links-old-version | Internal links must not have a hardcoded version using old versioning syntax | error | links, url, versioning |
31+
| GHD004 | image-file-kebab-case | Image file names must use kebab-case | error | images |
4632
| GHD005 | hardcoded-data-variable | Strings that contain "personal access token" should use the product variable instead | error | single-source |
47-
| GHD013 | github-owned-action-references | GitHub-owned action references should not be hardcoded | error | feature, actions |
48-
| GHD016 | liquid-quoted-conditional-arg | Liquid conditional tags should not quote the conditional argument | error | liquid, format |
49-
| GHD014 | liquid-data-references-defined | Liquid data or indented data references were found in content that have no value or do not exist in the data directory | error | liquid |
50-
| GHD015 | liquid-data-tag-format | Liquid data or indented data references tags must be correctly formatted and have the correct number of arguments and spacing | error | liquid, format |
51-
| GHD010 | frontmatter-hidden-docs | Articles with frontmatter property `hidden` can only be located in specific products | error | frontmatter, feature, early-access |
33+
| GHD006 | internal-links-old-version | Internal links must not have a hardcoded version using old versioning syntax | error | links, url, versioning |
34+
| GHD007 | code-annotations | Code annotations defined in Markdown must contain a specific layout frontmatter property | error | code, feature, annotate, frontmatter |
35+
| GHD008 | early-access-references | Files that are not early access should not reference early-access or early-access files | error | feature, early-access |
5236
| GHD009 | frontmatter-early-access-references | Files that are not early access should not have frontmatter that references early-access | error | frontmatter, feature, early-access |
37+
| GHD010 | frontmatter-hidden-docs | Articles with frontmatter property `hidden` can only be located in specific products | error | frontmatter, feature, early-access |
5338
| GHD011 | frontmatter-video-transcripts | Video transcript must be configured correctly | error | frontmatter, feature, video-transcripts |
5439
| GHD012 | frontmatter-schema | Frontmatter must conform to the schema | error | frontmatter, schema |
55-
| 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 |
40+
| GHD013 | github-owned-action-references | GitHub-owned action references should not be hardcoded | error | feature, actions |
41+
| GHD014 | liquid-data-references-defined | Liquid data or indented data references were found in content that have no value or do not exist in the data directory | error | liquid |
42+
| GHD015 | liquid-data-tag-format | Liquid data or indented data references tags must be correctly formatted and have the correct number of arguments and spacing | error | liquid, format |
43+
| GHD016 | liquid-quoted-conditional-arg | Liquid conditional tags should not quote the conditional argument | error | liquid, format |
5744
| GHD017 | frontmatter-liquid-syntax | Frontmatter properties must use valid Liquid | error | liquid, frontmatter |
5845
| GHD018 | liquid-syntax | Markdown content must use valid Liquid | error | liquid |
5946
| GHD019 | liquid-if-tags | Liquid `ifversion` tags should be used instead of `if` tags when the argument is a valid version | error | liquid, versioning |
6047
| GHD020 | liquid-ifversion-tags | Liquid `ifversion` tags should contain valid version names as arguments | error | liquid, versioning |
48+
| GHD021 | yaml-scheduled-jobs | YAML snippets that include scheduled workflows must not run on the hour and must be unique | error | feature, actions |
6149
| GHD022 | liquid-ifversion-versions | Liquid `ifversion`, `elsif`, and `else` tags should be valid and not contain unsupported versions. | error | liquid, versioning |
50+
| GHD030 | code-fence-line-length | Code fence lines should not exceed a maximum length | warning | code, accessibility |
51+
| GHD031 | image-alt-text-exclude-words | Alternate text for images should not begin with words like "image" or "graphic" | error | accessibility, images |
52+
| GHD032 | image-alt-text-end-punctuation | Alternate text for images should end with punctuation | error | accessibility, images |
53+
| GHD033 | incorrect-alt-text-length | Images alternate text should be between 40-150 characters | warning | accessibility, images |
54+
| GHD034 | list-first-word-capitalization | First word of list item should be capitalized | warning | ul, ol |
6255
| GHD035 | rai-reusable-usage | RAI articles and reusables can only reference reusable content in the data/reusables/rai directory | error | feature, rai |
6356
| GHD036 | image-no-gif | Image must not be a gif, styleguide reference: contributing/style-guide-and-content-model/style-guide.md#images | error | images |
6457
| GHD038 | expired-content | Expired content must be remediated. | warning | expired |
6558
| GHD039 | expiring-soon | Content that expires soon should be proactively addressed. | warning | expired |
66-
| [GHD040](https://github.com/github/docs/blob/main/src/content-linter/README.md) | table-liquid-versioning | Tables must use the correct liquid versioning format | error | tables |
67-
| GHD047 | table-column-integrity | Tables must have consistent column counts across all rows | warning | tables, accessibility, formatting |
59+
| GHD040 | table-liquid-versioning | Tables must use the correct liquid versioning format | error | tables |
6860
| GHD041 | third-party-action-pinning | Code examples that use third-party actions must always pin to a full length commit SHA | error | feature, actions |
6961
| GHD042 | liquid-tag-whitespace | Liquid tags should start and end with one whitespace. Liquid tag arguments should be separated by only one whitespace. | error | liquid, format |
7062
| GHD043 | link-quotation | Internal link titles must not be surrounded by quotations | error | links, url |
7163
| GHD044 | octicon-aria-labels | Octicons should always have an aria-label attribute even if aria-hidden. | warning | accessibility, octicons |
64+
| 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 |
7265
| GHD046 | outdated-release-phase-terminology | Outdated release phase terminology should be replaced with current GitHub terminology | warning | terminology, consistency, release-phases |
66+
| GHD047 | table-column-integrity | Tables must have consistent column counts across all rows | warning | tables, accessibility, formatting |
7367
| GHD048 | british-english-quotes | Periods and commas should be placed inside quotation marks (American English style) | warning | punctuation, quotes, style, consistency |
74-
| GHD050 | multiple-emphasis-patterns | Do not use more than one emphasis/strong, italics, or uppercase for a string | warning | formatting, emphasis, style |
7568
| GHD049 | note-warning-formatting | Note and warning tags should be formatted according to style guide | warning | formatting, callouts, notes, warnings, style |
69+
| GHD050 | multiple-emphasis-patterns | Do not use more than one emphasis/strong, italics, or uppercase for a string | warning | formatting, emphasis, style |
7670
| GHD051 | frontmatter-versions-whitespace | Versions frontmatter should not contain unnecessary whitespace | warning | frontmatter, versions |
77-
| GHD054 | third-party-actions-reusable | Code examples with third-party actions must include disclaimer reusable | warning | actions, reusable, third-party |
71+
| GHD054 | third-party-actions-reusable | Code examples with third-party actions must include disclaimer reusable | warning | actions, reusable, third-party |
72+
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: octicon-<icon-name> | The octicon liquid syntax used is deprecated. Use this format instead `octicon "<octicon-name>" aria-label="<Octicon aria label>"` | error | |
73+
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: site.data | Catch occurrences of deprecated liquid data syntax. | error | |
74+
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | developer-domain | Catch occurrences of developer.github.com domain. | error | |
75+
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | docs-domain | Catch occurrences of docs.github.com domain. | error | |
76+
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | help-domain | Catch occurrences of help.github.com domain. | error | |
77+
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | todocs-placeholder | Catch occurrences of TODOCS placeholder. | error | |

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

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { outdatedReleasePhaseTerminology } from '@/content-linter/lib/linting-ru
5050
import { britishEnglishQuotes } from '@/content-linter/lib/linting-rules/british-english-quotes'
5151
import { multipleEmphasisPatterns } from '@/content-linter/lib/linting-rules/multiple-emphasis-patterns'
5252
import { noteWarningFormatting } from '@/content-linter/lib/linting-rules/note-warning-formatting'
53+
5354
import { frontmatterVersionsWhitespace } from '@/content-linter/lib/linting-rules/frontmatter-versions-whitespace'
5455
import { thirdPartyActionsReusable } from '@/content-linter/lib/linting-rules/third-party-actions-reusable'
5556

@@ -62,52 +63,58 @@ const noGenericLinkText = markdownlintGitHub.find((elem) =>
6263

6364
export const gitHubDocsMarkdownlint = {
6465
rules: [
66+
// GH rules (markdownlint-github)
67+
noDefaultAltText, // GH001
68+
noGenericLinkText, // GH002
69+
70+
// GHD rules (GitHub Docs custom rules, in numerical order)
71+
linkPunctuation, // GHD001
72+
internalLinksNoLang, // GHD002
73+
internalLinksSlash, // GHD003
74+
imageFileKebabCase, // GHD004
75+
hardcodedDataVariable, // GHD005
76+
internalLinksOldVersion, // GHD006
77+
codeAnnotations, // GHD007
78+
earlyAccessReferences, // GHD008
79+
frontmatterEarlyAccessReferences, // GHD009
80+
frontmatterHiddenDocs, // GHD010
81+
frontmatterVideoTranscripts, // GHD011
82+
frontmatterSchema, // GHD012
83+
githubOwnedActionReferences, // GHD013
84+
liquidDataReferencesDefined, // GHD014
85+
liquidDataTagFormat, // GHD015
86+
liquidQuotedConditionalArg, // GHD016
87+
frontmatterLiquidSyntax, // GHD017
88+
liquidSyntax, // GHD018
89+
liquidIfTags, // GHD019
90+
liquidIfVersionTags, // GHD020
91+
yamlScheduledJobs, // GHD021
92+
liquidIfversionVersions, // GHD022
93+
codeFenceLineLength, // GHD030
94+
imageAltTextExcludeStartWords, // GHD031
95+
imageAltTextEndPunctuation, // GHD032
96+
incorrectAltTextLength, // GHD033
97+
listFirstWordCapitalization, // GHD034
98+
raiReusableUsage, // GHD035
99+
imageNoGif, // GHD036
100+
expiredContent, // GHD038
101+
expiringSoon, // GHD039
102+
tableLiquidVersioning, // GHD040
103+
thirdPartyActionPinning, // GHD041
104+
liquidTagWhitespace, // GHD042
105+
linkQuotation, // GHD043
106+
octiconAriaLabels, // GHD044
107+
codeAnnotationCommentSpacing, // GHD045
108+
outdatedReleasePhaseTerminology, // GHD046
109+
tableColumnIntegrity, // GHD047
110+
britishEnglishQuotes, // GHD048
111+
noteWarningFormatting, // GHD049
112+
multipleEmphasisPatterns, // GHD050
113+
frontmatterVersionsWhitespace, // GHD051
114+
115+
thirdPartyActionsReusable, // GHD054
116+
117+
// Search-replace rules
65118
searchReplace, // Open-source plugin
66-
noDefaultAltText, // markdownlint-github rule
67-
noGenericLinkText, // markdownlint-github rule
68-
codeFenceLineLength,
69-
imageAltTextEndPunctuation,
70-
imageFileKebabCase,
71-
incorrectAltTextLength,
72-
internalLinksNoLang,
73-
internalLinksSlash,
74-
imageAltTextExcludeStartWords,
75-
listFirstWordCapitalization,
76-
linkPunctuation,
77-
earlyAccessReferences,
78-
yamlScheduledJobs,
79-
internalLinksOldVersion,
80-
hardcodedDataVariable,
81-
githubOwnedActionReferences,
82-
liquidQuotedConditionalArg,
83-
liquidDataReferencesDefined,
84-
liquidDataTagFormat,
85-
frontmatterHiddenDocs,
86-
frontmatterEarlyAccessReferences,
87-
frontmatterVideoTranscripts,
88-
frontmatterSchema,
89-
codeAnnotations,
90-
codeAnnotationCommentSpacing,
91-
frontmatterLiquidSyntax,
92-
liquidSyntax,
93-
liquidIfTags,
94-
liquidIfVersionTags,
95-
liquidIfversionVersions,
96-
raiReusableUsage,
97-
imageNoGif,
98-
expiredContent,
99-
expiringSoon,
100-
tableLiquidVersioning,
101-
tableColumnIntegrity,
102-
thirdPartyActionPinning,
103-
liquidTagWhitespace,
104-
linkQuotation,
105-
octiconAriaLabels,
106-
outdatedReleasePhaseTerminology,
107-
britishEnglishQuotes,
108-
multipleEmphasisPatterns,
109-
noteWarningFormatting,
110-
frontmatterVersionsWhitespace,
111-
thirdPartyActionsReusable,
112119
],
113120
}

src/content-linter/lib/linting-rules/table-liquid-versioning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const tableLiquidVersioning = {
1414
description: 'Tables must use the correct liquid versioning format',
1515
severity: 'error',
1616
tags: ['tables'],
17-
information: new URL('https://github.com/github/docs/blob/main/src/content-linter/README.md'),
17+
1818
function: function GHD040(params, onError) {
1919
const lines = params.lines
2020
let inTable = false

src/content-linter/scripts/generate-docs.ts

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ function main() {
1414
markdown.push('| Rule ID | Rule Name(s) | Description | Severity | Tags |')
1515
markdown.push('| ------- | ------------ | ----------- | -------- | ---- |')
1616

17+
// Collect all rules and their generated rows
18+
const mdRules: Array<{ ruleId: string; row: string }> = []
19+
const ghRules: Array<{ ruleId: string; row: string }> = []
20+
const ghdRules: Array<{ ruleId: string; row: string }> = []
21+
const searchReplaceRows: string[] = []
22+
1723
for (const rule of allRules as Rule[]) {
1824
const ruleName = rule.names.find((name) => name in allConfig)
1925
if (!ruleName) continue
2026
if (rule.names.includes('search-replace')) {
21-
markdown.push(...getSearchReplaceRules(rule, allConfig[ruleName]))
27+
searchReplaceRows.push(...getSearchReplaceRules(rule, allConfig[ruleName]))
2228
continue
2329
}
2430
const row = []
@@ -28,8 +34,35 @@ function main() {
2834
row.push(rule.description)
2935
row.push(allConfig[ruleName].severity)
3036
row.push(rule.tags.join(', '))
31-
markdown.push(`| ${row.join(' | ')} |`)
37+
38+
// Categorize rules by their ID prefix
39+
const ruleData = { ruleId: rule.names[0], row: `| ${row.join(' | ')} |` }
40+
if (rule.names[0].startsWith('GHD')) {
41+
ghdRules.push(ruleData)
42+
} else if (rule.names[0].startsWith('GH')) {
43+
ghRules.push(ruleData)
44+
} else {
45+
mdRules.push(ruleData)
46+
}
47+
}
48+
49+
// Sort each category alphabetically by rule ID
50+
mdRules.sort((a, b) => a.ruleId.localeCompare(b.ruleId))
51+
ghRules.sort((a, b) => a.ruleId.localeCompare(b.ruleId))
52+
ghdRules.sort((a, b) => a.ruleId.localeCompare(b.ruleId))
53+
54+
// Add rules in order: MD rules, then GH rules, then GHD rules, then search-replace rules
55+
for (const { row } of mdRules) {
56+
markdown.push(row)
57+
}
58+
for (const { row } of ghRules) {
59+
markdown.push(row)
60+
}
61+
for (const { row } of ghdRules) {
62+
markdown.push(row)
3263
}
64+
markdown.push(...searchReplaceRows)
65+
3366
writeFileSync('data/reusables/contributing/content-linter-rules.md', markdown.join('\n'))
3467
}
3568

@@ -38,7 +71,11 @@ function main() {
3871
function getSearchReplaceRules(srRule: Rule, ruleConfig: Config) {
3972
const name = srRule.information ? `[search-replace](${srRule.information})` : 'search-replace'
4073
const markdown = []
41-
for (const rule of ruleConfig.rules || []) {
74+
75+
// Sort rules alphabetically by name
76+
const sortedRules = [...(ruleConfig.rules || [])].sort((a, b) => a.name.localeCompare(b.name))
77+
78+
for (const rule of sortedRules) {
4279
const row = []
4380
row.push(name)
4481
row.push(rule.name)

0 commit comments

Comments
 (0)