From 458b91313610419f1b67b9271e24bb05d953c578 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 30 Apr 2026 23:20:37 +0200 Subject: [PATCH] cfengine lint: Include .cf.sub files Among all the policy files in core and masterfiles, there are several .cf.sub files. We want to include these for linting. They (should) contain valid policy, and sometimes they contain body / bundle definitions used in other policy files. Eventually, we might choose to rename all of them to .sub.cf for a more "correct" file extension. Co-authored-by: Claude Opus 4.7 (1M context) Signed-off-by: Ole Herman Schumacher Elgesem --- src/cfengine_cli/lint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cfengine_cli/lint.py b/src/cfengine_cli/lint.py index bdad2a4..ad4d999 100644 --- a/src/cfengine_cli/lint.py +++ b/src/cfengine_cli/lint.py @@ -40,7 +40,7 @@ from cfbs.utils import find from cfengine_cli.utils import UserError -LINT_EXTENSIONS = (".cf", ".json") +LINT_EXTENSIONS = (".cf", ".cf.sub", ".json") DEFAULT_NAMESPACE = "default" VARS_TYPES = { "data", @@ -1012,7 +1012,7 @@ def _lint_main( if filename.endswith(".json"): errors += _lint_json_selector(filename) continue - assert filename.endswith(".cf") + assert filename.endswith((".cf", ".cf.sub")) policy_file = PolicyFile(filename, snippet) r = _check_syntax(policy_file, state) errors += r