add template deleted notice to template linting (#46347)
add template deleted notice Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
This commit is contained in:
parent
d94ed1a843
commit
b308132799
|
@ -37,6 +37,7 @@ export const scanForTemplateChanges = async (
|
||||||
) }).*`;
|
) }).*`;
|
||||||
|
|
||||||
const versionRegex = new RegExp( matchVersion, 'g' );
|
const versionRegex = new RegExp( matchVersion, 'g' );
|
||||||
|
const deletedRegex = new RegExp( '^deleted file mode [0-9]+' );
|
||||||
|
|
||||||
for ( const p in patches ) {
|
for ( const p in patches ) {
|
||||||
const patch = patches[ p ];
|
const patch = patches[ p ];
|
||||||
|
@ -51,9 +52,16 @@ export const scanForTemplateChanges = async (
|
||||||
for ( const l in lines ) {
|
for ( const l in lines ) {
|
||||||
const line = lines[ l ];
|
const line = lines[ l ];
|
||||||
|
|
||||||
|
if ( line.match( deletedRegex ) ) {
|
||||||
|
code = 'notice';
|
||||||
|
message = 'Template deleted';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ( line.match( versionRegex ) ) {
|
if ( line.match( versionRegex ) ) {
|
||||||
code = 'notice';
|
code = 'notice';
|
||||||
message = 'Version bump found';
|
message = 'Version bump found';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( repositoryPath ) {
|
if ( repositoryPath ) {
|
||||||
|
|
Loading…
Reference in New Issue