aboutsummaryrefslogtreecommitdiff
path: root/testdata/scan
AgeCommit message (Collapse)Author
2026-01-15all: allow multiple pattern in match-file-commentShulhan
This makes the configuration more concise where pattern can be split into multi lines. While at it, add more pattern to match-file-comment.
2026-01-15report: do not return an error if report file does not existShulhan
When scan running, it will try to load the previous report file to minimize re-scanning of file that has been applied or detected (regular or binary). If the report file does not exist, do not return the error, keep going.
2026-01-15all: add match-file-pattern for common filesShulhan
The Makefile, go.mod, and go.sum are known file names.
2026-01-14all: handle binary file in post-scanShulhan
File that match with match-file-pattern but without prefix and suffix will be marked as binary.
2026-01-14all: detect annotation from REUSE configurationShulhan
During scan, the program will read the REUSE.toml configuration. File that is already annotated inside REUSE.toml will be ignored during scan.
2026-01-14all: get the copyright year from git historyShulhan
If the line that match with pattern on match-copyright does not contains year, or there is no match, try to get the year from the first commit of the file using "git log --follow ..." command. If no commit history or its not using git, use default copyright year from configuration.
2026-01-13all: split the delete_line_pattern into before and afterShulhan
While at it, also add configuration for delete line before and after for match-copyright section.
2026-01-12all: fix default regex match license and copyright to ignore commentShulhan
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.
2026-01-12all: add configuration for setting default copyright yearShulhan
The `copyright_year` set the default year to be used in `SPDX-FileCopyrightText`. The year can be a single year (for example "2026"), range of year (for example, "2000-2026"), or list of year with comma separated (for example, "2000,2001,2026"); as long as there is no space in between.
2026-01-12all: implement match-file-comment for seting comment based on file nameShulhan
The first thing that the program do is to detect which comment string to be used when inserting SPDX identifiers in the file. For each pattern in the "match-file-comment" section, the program will match it with file name to get the comment prefix and suffix to be used later. User can add their own "match-file-comment" section as they like or modify the existing one. The "match-file-comment" can have empty prefix and suffix. That means, if the file name match, it will create new file with ".license" suffix that contains SPDX identifiers only, instead of inserting to the file.
2026-01-12config_match_license: remove unused field DeleteMatchShulhan
The line that match with pattern will be replaced with new SPDX license identifier, so no need to guard it with this flag.
2026-01-11all: exclude file that contains both SPDX license and copyright textShulhan
If the file already contains SPDX-License-Identifier and SPDX-FileCopyrightText, in any order, ignore it from being included during scan.
2026-01-11all: ignore symlink, COPYING, LICENSE, and LICENSESShulhan
For symlink, we ignore for now. COPYING, LICENSE, and LICENSES are common files part of SPDX/reuse specifications. While at it, fix checking if path is ignored by git by passing the relative path instead of base name.
2026-01-11all: fix slice bounds out of range when scanning dirShulhan
Using for-range and slices.Delete inside it will result an error out-of-range if the slices deleted multiple times.
2026-01-09all: implement the scan commandShulhan
The scan command scan the files that need to be converted or inserted with SPDX identifiers in the current directory. The result of scan is stored inside a report file named "spdxconv.report". There are no other files modified after scan completed. User then can inspect and modify the report to exclude certain files or changes the behaviour of apply command. Deleting a line in the report means excluding the file from being processed by "apply" command.
2026-01-08all: fix wrong copyright year on some filesShulhan
I wrote the initial codes in December 2025 but commit it on year 2026.
2026-01-08all: add missing license and copyrightShulhan
Ah, the irony.
2026-01-08all: implement conversion for SPDX-License-IdentifierShulhan
If the file contains "SPDX-License-Identifier", it will not modify it. The program will move the identifier to the top of file after shebang. If the spdxconv.cfg contains match-license, and the pattern match with one of the line in the file, it will use the license_identifier instead of default one and insert it at the top, after shebang. If the files does not contains the identifier, it will insert new one based on default value in spdxconv.cfg file.
2026-01-07all: exclude file that have ".license" fileShulhan
If the file X has another file named "X.license" in the same directory, exclude it for being processed. The ".license" is SPDX specific file that contains only SPDX identifiers.
2026-01-06spdxconv: tool to convert license and copyright to SPDX formatShulhan
This is the initial implementation, work in progress, with the following functions, * loading the spdxconv.cfg file * scanning list of files to be converted * detect .git repository and exclude files ignored by .gitignore No conversion logic is implemented yet.