Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieulemieux committed Nov 22, 2024
1 parent f5b7093 commit 14c3da9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/civic/evidenceItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const processCombination = async (conn, {
const processedVariants = await processVariantRecord(conn, variant, feature);
logger.verbose(`converted variant name (${variant.name}) to variants (${processedVariants.map(v => v.displayName).join(', and ')})`);
variants.push(...processedVariants);
} catch {
} catch (err) {
throw new Error(`unable to process the variant (id=${variant.id}, name=${variant.name})`);
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/civic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ const upload = async ({
processingIntoCombinations: new Map(),
relevance: new Map(),
};
const statementsToReview_unmatched_processingError = new Map();
const statementsToReview_unmatched = new Map();
const statementsToReviewUnmatchedProcessingError = new Map();
const statementsToReviewUnmatched = new Map();

logger.info(`\n\n${'#'.repeat(80)}\n## PROCESSING RECORDS\n${'#'.repeat(80)}\n`);
let recordNumber = 0;
Expand Down Expand Up @@ -378,11 +378,11 @@ const upload = async ({
if (processCombinationErrors > 0) {
// Do not delete any statements if some combinations have processing errors
logger.warn(`${toDelete.length} unmatched statement(s). To be reviewed since some processing errors occured`);
statementsToReview_unmatched_processingError.set(id, rids);
statementsToReviewUnmatchedProcessingError.set(id, rids);
} else if (noDeleteOnUnmatched) {
// Do not delete any statements if noDeleteOnUnmatched flag
logger.warn(`${toDelete.length} unmatched statement(s). To be reviewed since the noDeleteOnUnmatched flag is being used`);
statementsToReview_unmatched.set(id, rids);
statementsToReviewUnmatched.set(id, rids);
} else {
loaclCountsST.delete = await deleteStatements(conn, { rids });
}
Expand Down Expand Up @@ -427,7 +427,7 @@ const upload = async ({
// sourceIds no longer in CIViC (not accepted/submitted-by-trustedCurators) but still in GraphKB
const allIdsFromCivic = new Set(evidenceItems.map(r => r.id.toString()));
const sourceIdstoDeleteStatementsFrom = Array.from(
new Set([...sourceIdsFromGKB].filter(x => !allIdsFromCivic.has(x)))
new Set([...sourceIdsFromGKB].filter(x => !allIdsFromCivic.has(x))),
);
logger.info();
logger.info('***** Deprecated items *****');
Expand All @@ -441,7 +441,7 @@ const upload = async ({
if (sourceIdstoDeleteStatementsFrom.length > 0) {
if (!deleteDeprecated) {
// Do not delete any statements if no deleteDeprecated flag
const deprecatedStatementRids = await getStatements(conn, { source: sourceRid, sourceIds: sourceIdstoDeleteStatementsFrom});
const deprecatedStatementRids = await getStatements(conn, { source: sourceRid, sourceIds: sourceIdstoDeleteStatementsFrom });
logger.warn(`${deprecatedStatementRids.length} corresponding deprecated statement(s). To be reviewed since no deleteDeprecated flag`);

Check failure on line 445 in src/civic/index.js

View workflow job for this annotation

GitHub Actions / node-12

Trailing spaces not allowed
const deprecatedStatementsFilepath = `${errorLogPrefix}-civic-deprecatedStatements.json`;
logger.info(`writing ${deprecatedStatementsFilepath}`);
Expand All @@ -467,10 +467,10 @@ const upload = async ({
// so a reviewer can decide if corresponding statements need to be deleted or not
logger.info();
logger.info('***** Unmatched cases to be reviewed for deletion *****');
logger.warn(`${statementsToReview_unmatched_processingError.size} Evidence Item(s) with processing errors leading to unmatched Statement(s)`);
statementsToReview_unmatched_processingError.forEach((v, k) => logger.info(`${k} -> ${JSON.stringify(v)}`));
logger.warn(`${statementsToReview_unmatched.size} Evidence Item(s) with unmatched Statement(s) with no processing error involved`);
statementsToReview_unmatched.forEach((v, k) => logger.info(`${k} -> ${JSON.stringify(v)}`));
logger.warn(`${statementsToReviewUnmatchedProcessingError.size} Evidence Item(s) with processing errors leading to unmatched Statement(s)`);
statementsToReviewUnmatchedProcessingError.forEach((v, k) => logger.info(`${k} -> ${JSON.stringify(v)}`));
logger.warn(`${statementsToReviewUnmatched.size} Evidence Item(s) with unmatched Statement(s) with no processing error involved`);
statementsToReviewUnmatched.forEach((v, k) => logger.info(`${k} -> ${JSON.stringify(v)}`));

// Logging Statement CRUD operations counts
if (countsST) {
Expand Down
4 changes: 2 additions & 2 deletions src/civic/variant.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const uploadNormalizedVariant = async (conn, normalizedVariant, feature) => {
} catch (err) {
try {
variantType = await conn.getVocabularyTerm(normalizedVariant.type || content.type);
} catch {
} catch (e) {
throw new Error(`Unable to upload CIVIC variant (${normalizedVariant}})`);
}
}
Expand Down Expand Up @@ -396,7 +396,7 @@ const processVariantRecord = async (conn, civicVariantRecord, feature) => {
}
} catch (err) {
VARIANT_CACHE.set(JSON.stringify(rawVariant), { err });
throw err
throw err;
}

VARIANT_CACHE.set(JSON.stringify(rawVariant), { result });
Expand Down

0 comments on commit 14c3da9

Please sign in to comment.