public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH] CLAUDE.md: Suggest method for checking generated Kconfig files
Date: Fri, 31 Oct 2025 20:50:13 -0400	[thread overview]
Message-ID: <20251101005020.3492781-2-cel@kernel.org> (raw)
In-Reply-To: <20251101005020.3492781-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

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 <chuck.lever@oracle.com>
---
 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


  reply	other threads:[~2025-11-01  0:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01  0:50 [PATCH 0/7] Remove support for OpenStack-based clouds Chuck Lever
2025-11-01  0:50 ` Chuck Lever [this message]
2025-11-01  0:50 ` [PATCH 1/7] docs: Remove OpenStack documentation Chuck Lever
2025-11-01  0:50 ` [PATCH 2/7] CLAUDE.md: Remove OpenStack from infrastructure list Chuck Lever
2025-11-01  0:50 ` [PATCH 3/7] kconfigs: Remove remaining OpenStack references Chuck Lever
2025-11-01  0:50 ` [PATCH 4/7] scripts: Remove OpenStack from terraform.Makefile Chuck Lever
2025-11-01  0:50 ` [PATCH 5/7] playbooks: Remove OpenStack ansible support Chuck Lever
2025-11-01  0:50 ` [PATCH 6/7] terraform: Remove OpenStack from Kconfig.providers Chuck Lever
2025-11-01  0:50 ` [PATCH 7/7] terraform: Remove OpenStack provider directory Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251101005020.3492781-2-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox