From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDF5634D3B8 for ; Sat, 1 Nov 2025 00:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761958224; cv=none; b=kfYa0Yu8Z9TTjzOgvaV9/hr94WFE21BJjrMSuAzFi6v7RHZjVu28VCWpmFcNEOp3iKdA8YWA2w8CwQCYmyKoM3oVuUuaNVzUdUk5UUiJPvMeAIFR8GnN+3azhVpxmQvxlECyIC4Ufp5KyqamS2KpsBfmhLaZfYiDbklCIv9hA70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761958224; c=relaxed/simple; bh=ufQ8AiaEhLkezucYZEvH8R9LlJG/B+21poiIgLi2hTs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MkJgTYP1oiZIUasJ2kr8P2VzE2rNdJ4hJNOA19Qyx4dpQLzSrpOuYte/abMtgxNdiwkzTAY1ZyCTwgaf4Jwnhe7DC+BR3IxKAjTOhNghUcB6bvd/sA3Cz9wtoA0tdGBr5LqkGxN/oQwBul8TDwwbBol8MrUA0BSqXichrNo2Jzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vDMotnv9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vDMotnv9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4814BC4CEFD; Sat, 1 Nov 2025 00:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761958223; bh=ufQ8AiaEhLkezucYZEvH8R9LlJG/B+21poiIgLi2hTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDMotnv97BWJfvkMxYrWybB9cL/KalxwR14T9af6ByUHuWVxqzLs+I7JLy0ISJBCF /r8nATbmlDsJDeqYLrdfQXr3DKpLRhq4dDYn5P19tOynPznNIto0+uF+7qck0gGqh6 pZAKMWT5PqWMuKn1Eta0vyTu1YwiMXUxf0XAXak6xz/DEtzD2YbdNzGGjlICtzqO5H ASszsaJAaQ/hjbIkYLlbhfT7ugBmAEIvQip6HdIdnTh4sPCX4z3bm8ZGj/5DW9j/qX 4BJ4h19G4rwE6iHvsWU/RNIid1Ys1mpq8LJauTergh4eZcEVcJtvOMdjPMRGz89L0o c8xrblvG/HdLA== From: Chuck Lever To: Cc: Chuck Lever Subject: [PATCH] CLAUDE.md: Suggest method for checking generated Kconfig files Date: Fri, 31 Oct 2025 20:50:13 -0400 Message-ID: <20251101005020.3492781-2-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251101005020.3492781-1-cel@kernel.org> References: <20251101005020.3492781-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Claude was struggling a bit with how to validate the whitespace in .j2 files used to generate Kconfig menus. We stumbled on this method: generate a sample menu file and check that. Generated-by: Claude AI Signed-off-by: Chuck Lever --- CLAUDE.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 1ca86b9ecb9d..188e6dc96bfa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -527,6 +527,28 @@ make fix-whitespace-last-commit This will fix all white space only for new files you add. +### Testing Generated Kconfig Files + +When working with scripts that generate Kconfig files (like `terraform/*/scripts/gen_kconfig_*`), +the indentation checker cannot properly validate Jinja2 template files (.j2) because they +can generate any kind of output, not just Kconfig. + +**Correct approach**: Generate the output to a file named with "Kconfig" prefix and test that: + +```bash +# Example: Testing AWS AMI Kconfig generation +cd terraform/aws/scripts +python3 gen_kconfig_ami --quiet > /tmp/Kconfig.ami.test 2>&1 +python3 ../../../scripts/detect_indentation_issues.py /tmp/Kconfig.ami.test +``` + +The indentation checker recognizes files starting with "Kconfig" and applies the correct +rules (tabs for indentation, tab+2spaces for help text is valid). + +**Why this matters**: Jinja2 templates (.j2) are generic and can generate Python, YAML, +Kconfig, or any other format. The style checker cannot determine the output format from +the template filename alone. Always test the generated output, not the template. + ## Complex System Interactions kdevops integrates multiple subsystems (Ansible, Kconfig, Git, Make) that often -- 2.51.0