Skip to content

Commit

Permalink
Merge pull request #19 from duckdb/jray/add-logging-to-check-func-sig…
Browse files Browse the repository at this point in the history
…s-script

add logging to check func sigs script
  • Loading branch information
jraymakers authored Oct 8, 2024
2 parents 17b375e + f3ebf0f commit 76f2796
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bindings/scripts/checkFunctionSignatures.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,24 @@ function checkFunctionSignatures() {
const typeDefsSigs = getFunctionSignaturesFromComments(typeDefsFilePath);
const bindingsSigs = getFunctionSignaturesFromComments(bindingsFilePath);

console.log(`header sigs: ${headerSigs.length}`);
console.log(`type defs sigs: ${typeDefsSigs.length}`);
console.log(`bindings sigs: ${bindingsSigs.length}`);

const headerSigsJSON = JSON.stringify(headerSigs, null, 2);
const typeDefsSigsJSON = JSON.stringify(typeDefsSigs, null, 2);
const bindingsSigsJSON = JSON.stringify(bindingsSigs, null, 2);

if (headerSigsJSON !== typeDefsSigsJSON) {
console.warn('Type defs different!');
if (headerSigsJSON === typeDefsSigsJSON) {
console.log('OK: Type defs sigs match header sigs');
} else {
console.warn('WARNING: Type defs sigs DO NOT match header sigs!');
}
if (headerSigsJSON !== bindingsSigsJSON) {
console.warn('Bindings different!');

if (headerSigsJSON === bindingsSigsJSON) {
console.log('OK: Bindings sigs match header sigs');
} else {
console.warn('WARNING: Bindings sigs DO NOT match header sigs!');
}

if (process.argv[2] === 'writeFiles') {
Expand Down

0 comments on commit 76f2796

Please sign in to comment.