Skip to content

Commit

Permalink
Merge pull request github#26918 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot committed Jul 20, 2023
2 parents ff05175 + 2212289 commit a7099e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
3 changes: 2 additions & 1 deletion src/content-linter/scripts/markdownlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function main() {

// Apply markdownlint fixes if available and rewrite the files
if (fix) {
for (const file of files) {
for (const file of [...files.content, ...files.data]) {
const content = await readFile(file, 'utf8')
const applied = applyFixes(content, results[file])
await writeFile(file, applied)
Expand Down Expand Up @@ -155,6 +155,7 @@ function reportSummaryByRule(results, config) {
}

function reportResults(results) {
console.log('\n\nMarkdownlint results:\n')
Object.entries(results)
// Each result key always has an array value, but it may be empty
.filter(([, result]) => result.length)
Expand Down
38 changes: 7 additions & 31 deletions src/content-linter/style/base.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import highlightJs from 'highlight.js'

const highlightJsLanguages = highlightJs.listLanguages()
const languageAliases = ['text']
const allowedCodeFenceLanguages = new Set([...highlightJsLanguages, ...languageAliases])

export const baseConfig = {
// Don't run all rules by default. This must be done first to
// enable a specific set of rules.
Expand Down Expand Up @@ -94,37 +100,7 @@ export const baseConfig = {
// MD040
severity: 'warning',
'partial-markdown-files': true,
allowed_languages: [
'bash',
'csharp',
'geojson',
'go',
'golang',
'graphql',
'groovy',
'html',
'http',
'java',
'javascript',
'json',
'markdown',
'math',
'md',
'mermaid',
'powershell',
'python',
'ruby',
'scss',
'shell',
'sh',
'stl',
'tasklist',
'text',
'topojson',
'xml',
'yaml',
'yml',
],
allowed_languages: allowedCodeFenceLanguages,
},
'no-empty-links': {
// MD042
Expand Down
2 changes: 1 addition & 1 deletion src/rest/components/get-rest-code-samples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function getShellExample(operation: Operation, codeSample: CodeSample) {
apiVersionHeader =
allVersions[currentVersion].apiVersions.length > 0 &&
allVersions[currentVersion].latestApiVersion
? `\\\n -H "X-GitHub-Api-Version: ${allVersions[currentVersion].latestApiVersion}"`
? ` \\\n -H "X-GitHub-Api-Version: ${allVersions[currentVersion].latestApiVersion}"`
: ''
}

Expand Down

0 comments on commit a7099e5

Please sign in to comment.