Followup TODOCS linter fixes (#58000)
This commit is contained in:
@@ -430,11 +430,15 @@ function getFormattedResults(allResults, isPrecommit) {
|
|||||||
const formattedResults = results
|
const formattedResults = results
|
||||||
.map((flaw) => formatResult(flaw, isPrecommit))
|
.map((flaw) => formatResult(flaw, isPrecommit))
|
||||||
.filter((flaw) => shouldIncludeResult(flaw, key))
|
.filter((flaw) => shouldIncludeResult(flaw, key))
|
||||||
|
|
||||||
|
// Only add the file to output if there are results after filtering
|
||||||
|
if (formattedResults.length > 0) {
|
||||||
const errors = formattedResults.filter((result) => result.severity === 'error')
|
const errors = formattedResults.filter((result) => result.severity === 'error')
|
||||||
const warnings = formattedResults.filter((result) => result.severity === 'warning')
|
const warnings = formattedResults.filter((result) => result.severity === 'warning')
|
||||||
const sortedResult = [...errors, ...warnings]
|
const sortedResult = [...errors, ...warnings]
|
||||||
output[key] = [...sortedResult]
|
output[key] = [...sortedResult]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
// Configuration for which rules should be included in automated weekly reports
|
|
||||||
export const reportingConfig = {
|
export const reportingConfig = {
|
||||||
// Always include all rules with these severities
|
// Always include all rules with these severities in automated weekly reports
|
||||||
includeSeverities: ['error'],
|
includeSeverities: ['error'],
|
||||||
|
|
||||||
// Specific rules to include regardless of severity
|
// Specific rules to include regardless of severity
|
||||||
@@ -10,18 +9,19 @@ export const reportingConfig = {
|
|||||||
'expired-content',
|
'expired-content',
|
||||||
],
|
],
|
||||||
|
|
||||||
// Specific rules to exclude from reports (overrides severity-based inclusion)
|
// Specific rules to exclude from CI and reports (overrides severity-based inclusion)
|
||||||
// Add rule names here if you want to suppress them from reports
|
// Add rule names here if you want to suppress them from reports
|
||||||
excludeRules: [
|
excludeRules: [
|
||||||
// Example: 'GHD030' // Uncomment to exclude code-fence-line-length warnings
|
// Example: 'GHD030' // Uncomment to exclude code-fence-line-length warnings
|
||||||
'british-english-quotes', // Exclude from reports but keep for pre-commit
|
'british-english-quotes', // Exclude from reports but keep for pre-commit
|
||||||
],
|
],
|
||||||
|
|
||||||
// Files to exclude from specific rules in reports
|
// Files to exclude from specific rules in CI and reports
|
||||||
// Format: { 'rule-name': ['file/path/pattern1', 'file/path/pattern2'] }
|
// Format: { 'rule-name': ['file/path/pattern1', 'file/path/pattern2'] }
|
||||||
excludeFilesFromRules: {
|
excludeFilesFromRules: {
|
||||||
'todocs-placeholder': [
|
'todocs-placeholder': [
|
||||||
'content/contributing/collaborating-on-github-docs/using-the-todocs-placeholder-to-leave-notes.md',
|
'content/contributing/collaborating-on-github-docs/using-the-todocs-placeholder-to-leave-notes.md',
|
||||||
|
'content/contributing/collaborating-on-github-docs/index.md',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user