diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-12 23:01:35 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-01-12 23:01:35 +0700 |
| commit | e16e2a4ec74443aa8f4c21a73ee837cb72ed46fb (patch) | |
| tree | 8458e4f7bc3803310f1e4071a28a70bb8f0fd939 /testdata/scan/spdxconv.cfg | |
| parent | 9817757f8dca159aa261315a91fceff1d9a13566 (diff) | |
| download | spdxconv-e16e2a4ec74443aa8f4c21a73ee837cb72ed46fb.tar.xz | |
all: fix default regex match license and copyright to ignore comment
Instead of assuming that the comment prefix and space always exists
"^(//)\s+..."
change it to be optional, so it will works on the multi-line comment.
For example, comment and old headers in html,
<--
Copyright ...
-->
there is no comment prefix and space.
Diffstat (limited to 'testdata/scan/spdxconv.cfg')
| -rw-r--r-- | testdata/scan/spdxconv.cfg | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testdata/scan/spdxconv.cfg b/testdata/scan/spdxconv.cfg index 59ae864..3b137b6 100644 --- a/testdata/scan/spdxconv.cfg +++ b/testdata/scan/spdxconv.cfg @@ -43,9 +43,9 @@ prefix = "%" pattern = "^.*\\.(apk|app|bz2|csv|doc|docx|exe|gif|gz|jpeg|jpg|json|pdf|png|ppt|pptx|svg|svgz|tar|tgz|xls|xlsx|zip)$" [match-license] -pattern = "^(//+|#+)\\s+(.*)governed by a BSD-style(.*)$" +pattern = "^(//+|#+|/\\*+|<!--+)?\\s*(.*)governed by a BSD-style(.*)$" license_identifier = BSD-3-Clause -delete_line_pattern = "^(//+|#+)\\s+license that(.*)$" +delete_line_pattern = "^(//+|#+|/\\*+|<!--+)?\\s*license that can(.*)$" [match-copyright] -pattern = "^(//+|#+)\\s+Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<*(?<contact>.*)>.*$" +pattern = "^(//+|#+|/\\*+|<!--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$" |
