This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/sbp by this push:
     new 1f756ffe Classify CycloneDX JSON SBOM files correctly as metadata
1f756ffe is described below

commit 1f756ffeb37f7c6530677f8c3cc63a82f5da9526
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Feb 13 18:40:34 2026 +0000

    Classify CycloneDX JSON SBOM files correctly as metadata
---
 atr/analysis.py | 6 ++++++
 atr/classify.py | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/atr/analysis.py b/atr/analysis.py
index 4e59cf0c..4b617d1b 100755
--- a/atr/analysis.py
+++ b/atr/analysis.py
@@ -129,6 +129,12 @@ SKIPPABLE_SUFFIXES: Final[list[str]] = [
     ".yaml",
 ]
 
+STANDALONE_METADATA_SUFFIXES: Final[frozenset[str]] = frozenset(
+    {
+        ".cdx.json",
+    }
+)
+
 # Should perhaps not include javadoc
 # app
 # doc
diff --git a/atr/classify.py b/atr/classify.py
index f909dc9e..efb6e6db 100644
--- a/atr/classify.py
+++ b/atr/classify.py
@@ -38,10 +38,15 @@ def classify(
     if (path.name in analysis.DISALLOWED_FILENAMES) or (path.suffix in 
analysis.DISALLOWED_SUFFIXES):
         return FileType.DISALLOWED
 
-    search = re.search(analysis.extension_pattern(), str(path))
+    path_str = str(path)
+
+    search = re.search(analysis.extension_pattern(), path_str)
     if search and search.group("metadata"):
         return FileType.METADATA
 
+    if any(path_str.endswith(s) for s in 
analysis.STANDALONE_METADATA_SUFFIXES):
+        return FileType.METADATA
+
     if search and search.group("artifact") and (source_matcher is not None) 
and (base_path is not None):
         if source_matcher(str(base_path / path)):
             return FileType.SOURCE


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to