Skip to content

Commit ea6e10b

Browse files
authored
Reactivate RAI linter rules (GHD035, GHD064) (#61444)
1 parent c8ff184 commit ea6e10b

3 files changed

Lines changed: 14 additions & 17 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
| GHD032 | image-alt-text-end-punctuation | Alternate text for images should end with punctuation | error | accessibility, images |
4545
| GHD033 | incorrect-alt-text-length | Images alternate text should be between 40-150 characters | error | accessibility, images |
4646
| GHD034 | frontmatter-curly-quotes | Frontmatter title and intro should not contain curly quotes | error | frontmatter, format |
47+
| GHD035 | rai-reusable-usage | RAI articles and reusables can only reference reusable content in the data/reusables/rai directory | error | feature, rai |
4748
| GHD036 | image-no-gif | Image must not be a gif, styleguide reference: contributing/style-guide-and-content-model/style-guide.md#images | error | images |
4849
| GHD038 | expired-content | Expired content must be remediated. | warning | expired |
4950
| GHD039 | expiring-soon | Content that expires soon should be proactively addressed. | warning | expired |
@@ -64,6 +65,7 @@
6465
| GHD061 | frontmatter-hero-image | Hero image paths must be absolute, extensionless, and point to valid images in /assets/images/banner-images/ | error | frontmatter, images |
6566
| GHD062 | frontmatter-intro-links | introLinks keys must be valid keys defined in data/ui.yml under product_landing | error | frontmatter, single-source |
6667
| GHD063 | frontmatter-children | Children frontmatter paths must exist. Supports relative paths and absolute /content/ paths for cross-product inclusion. | error | frontmatter, children |
68+
| GHD064 | rai-app-card-structure | RAI application/platform card articles must follow the required template structure | error | feature, rai |
6769
| GHD065 | frontmatter-content-type | Content files in content-type directories must have a contentType frontmatter property that matches the parent directory. | error | frontmatter, content-type |
6870
| GHD066 | frontmatter-docs-team-metrics | Articles whose path contains a docsTeamMetrics value must include that value in their docsTeamMetrics frontmatter property. | error | frontmatter, docs-team-metrics |
6971
| [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 | |

src/content-linter/lib/linting-rules/rai-app-card-structure.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ interface Frontmatter {
331331

332332
function isFileRaiCard(params: RuleParams): boolean {
333333
const fm: Frontmatter = (getFrontmatter(params.frontMatterLines) as Frontmatter) || {}
334-
return fm.contentType === 'rai'
334+
// Files with children: are landing pages that aggregate cards, not cards themselves.
335+
return fm.contentType === 'rai' && !('children' in fm)
335336
}
336337

337338
export const raiAppCardStructure: Rule = {

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

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,11 @@ const githubDocsConfig = {
119119
'partial-markdown-files': true,
120120
'yml-files': true,
121121
},
122-
// 'rai-reusable-usage': {
123-
// // GHD035
124-
// // Temporarily disabled until RAI application card PRs merge.
125-
// // Re-enable by uncommenting this block.
126-
// // See: github/docs-internal#59611, #59934, #59936
127-
// severity: 'error',
128-
// 'partial-markdown-files': true,
129-
// },
122+
'rai-reusable-usage': {
123+
// GHD035
124+
severity: 'error',
125+
'partial-markdown-files': true,
126+
},
130127
'image-no-gif': {
131128
// GHD036
132129
severity: 'error',
@@ -190,14 +187,11 @@ const githubDocsConfig = {
190187
'partial-markdown-files': true,
191188
'yml-files': true,
192189
},
193-
// 'rai-app-card-structure': {
194-
// // GHD064
195-
// // Temporarily disabled until RAI application card PRs merge.
196-
// // Re-enable by uncommenting this block (use 'error' once migration is complete per github/docs-team#6340).
197-
// // See: github/docs-internal#59611, #59934, #59936
198-
// severity: 'warning',
199-
// 'partial-markdown-files': false,
200-
// },
190+
'rai-app-card-structure': {
191+
// GHD064
192+
severity: 'error',
193+
'partial-markdown-files': false,
194+
},
201195
}
202196

203197
export const githubDocsFrontmatterConfig = {

0 commit comments

Comments
 (0)