| Age | Commit message (Collapse) | Author |
|
|
|
This makes the configuration more concise where pattern can be split
into multi lines.
While at it, add more pattern to match-file-comment.
|
|
The done group contain list of file that has been processed.
File from group regular and binary that has been modified or added with
SPDX format will be moved to here.
|
|
|
|
During scan, the program will read the REUSE.toml configuration.
File that is already annotated inside REUSE.toml will be ignored during
scan.
|
|
|
|
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.
|
|
While at it, also add configuration for delete line before and after
for match-copyright section.
|
|
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.
|
|
|
|
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.
|
|
The line that match with pattern will be replaced with new SPDX license
identifier, so no need to guard it with this flag.
|
|
The apply command read the "spdxconv.report" and apply the license and
copyright as stated on each file in the report.
A file that has been successfully processed will be removed from the
report.
|
|
For the index line number, instead of tied to license_id and copyright_id
value (separated by ":"), store it in separate column as idx_license_id
and idx_copyright_id.
For comments, store the prefix and suffix at column 6 and 7 in CSV line.
|
|
Using space separated with double quote on some fields are not easy to
parse.
Using CSV allow us to use the [encoding/csv] package from standard
library.
|
|
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.
|
|
I wrote the initial codes in December 2025 but commit it on year 2026.
|
|
The init command create the spdxconv configuration file in the current
directory.
|
|
Ah, the irony.
|
|
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.
|