From e0c0fdd738d667930b95dfec863ac441b52030ad Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 26 Feb 2026 14:42:47 +0100 Subject: [PATCH] feat: allow caller to audit specific languages (#66110) --- curriculum/src/challenge-auditor/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/curriculum/src/challenge-auditor/index.ts b/curriculum/src/challenge-auditor/index.ts index 3bcfc49ad3b..82756d466cf 100644 --- a/curriculum/src/challenge-auditor/index.ts +++ b/curriculum/src/challenge-auditor/index.ts @@ -1,3 +1,4 @@ +import { parseArgs } from 'node:util'; import { flatten } from 'lodash/fp'; import { availableLangs } from '@freecodecamp/shared/config/i18n'; @@ -7,6 +8,11 @@ import { } from '@freecodecamp/shared/config/curriculum'; import { getChallengesForLang } from '../get-challenges.js'; +import { isEmpty } from 'lodash'; + +const { + values: { language: languages } +} = parseArgs({ options: { language: { type: 'string', multiple: true } } }); // TODO: re-organise the types to a common 'types' folder that can be shared // between the workspaces so we don't have to declare ChallengeNode here and in @@ -43,9 +49,9 @@ const getChallenges = async (lang: string) => { void (async () => { let actionShouldFail = false; - const langsToCheck = availableLangs.curriculum.filter( - lang => String(lang) !== 'english' - ); + const langsToCheck = isEmpty(languages) + ? availableLangs.curriculum.filter(lang => String(lang) !== 'english') + : languages!; for (const language of langsToCheck) { console.log(`\n=== ${language} ===`); const certs = getAuditedSuperBlocks({ language });