1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Search replace linter bug (#43284)

This commit is contained in:
Rachael Sewell
2023-09-25 16:13:13 -07:00
committed by GitHub
parent a198af2c47
commit b8dfb50528
5 changed files with 21 additions and 7 deletions

View File

@@ -72,7 +72,7 @@ export const searchReplaceConfig = {
message: 'Catch occurrences of docs.gitub.com domain.',
search: 'docs.github.com',
searchScope: 'all',
severity: 'error',
severity: 'warning',
'partial-markdown-files': true,
},
{
@@ -110,6 +110,8 @@ export const searchReplaceConfig = {
message: 'Catch occurrences of deprecated liquid data syntax.',
searchPattern: '/{{\\s*?site\\.data\\.([a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]+)+)\\s*?}}/g',
replace: '{% data $1 %}',
severity: 'error',
'partial-markdown-files': true,
},
{
// Catches usage of old octicon variable syntax. For example:
@@ -119,6 +121,8 @@ export const searchReplaceConfig = {
message:
'The octicon liquid syntax used is deprecated. Use this format instead {% octicon "<octicon-name>" aria-label="<Octicon aria label>" %}',
searchPattern: '/{{\\s*?octicon-([a-z-]+)(\\s[\\w\\s\\d-]+)?\\s*?}}/g',
severity: 'error',
'partial-markdown-files': true,
},
{
// Catches usage of string personal access token, which should
@@ -127,6 +131,8 @@ export const searchReplaceConfig = {
message:
'The string "personal access token" can be replaced with a variable. You should use one of the variables from data/variables/product.yml instead of the literal phrase(s):',
searchPattern: '/personal access tokens?/gi',
severity: 'warning',
'partial-markdown-files': true,
},
{
// Catches usage of GitHub-owned actions that don't use a
@@ -156,7 +162,11 @@ export const searchReplaceConfig = {
'A GitHub-owned action is referenced, but should be replaced with a reusable from data/reusables/actions.',
searchPattern:
'/(actions\\/(checkout|delete-package-versions|download-artifact|upload-artifact|github-script|setup-dotnet|setup-go|setup-java|setup-node|setup-python|stale|cache)|github\\/codeql-action[/a-zA-Z-]*)/g',
severity: 'warning',
'partial-markdown-files': true,
},
],
},
}
export const customConfig = { ...searchReplaceConfig, ...githubDocsConfig }