Fix a minor bug in code analyzer and improve logging for when no changes exist (#36915)

This commit is contained in:
Sam Seay 2023-03-01 12:34:19 +13:00 committed by GitHub
parent bd6586a378
commit 48cd5917ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View File

@ -64,6 +64,15 @@ const program = new Command()
'TEMPLATES',
Logger.notice
);
} else {
Logger.notice( '\n\n## TEMPLATE CHANGES' );
Logger.notice(
'---------------------------------------------------'
);
Logger.notice( 'No template changes found.' );
Logger.notice(
'---------------------------------------------------'
);
}
if ( changes.hooks.size ) {
@ -73,6 +82,15 @@ const program = new Command()
'HOOKS',
Logger.notice
);
} else {
Logger.notice( '\n\n## HOOK CHANGES' );
Logger.notice(
'---------------------------------------------------'
);
Logger.notice( 'No hook changes found.' );
Logger.notice(
'---------------------------------------------------'
);
}
if ( changes.schema.filter( ( s ) => ! s.areEqual ).length ) {
@ -82,10 +100,28 @@ const program = new Command()
outputStyle,
Logger.notice
);
} else {
Logger.notice( '\n\n## SCHEMA CHANGES' );
Logger.notice(
'---------------------------------------------------'
);
Logger.notice( 'No schema changes found.' );
Logger.notice(
'---------------------------------------------------'
);
}
if ( changes.db ) {
printDatabaseUpdates( changes.db, outputStyle, Logger.notice );
} else {
Logger.notice( '\n\n## DB CHANGES' );
Logger.notice(
'---------------------------------------------------'
);
Logger.notice( 'No db changes found.' );
Logger.notice(
'---------------------------------------------------'
);
}
} );

View File

@ -32,6 +32,8 @@ export const scanForChanges = async (
? clonedPath
: await cloneRepo( source );
Logger.endTask();
Logger.notice(
`Temporary clone of ${ source } created at ${ tmpRepoPath }`
);