From ca472c1d51f3304c86c8e33876192e022ffc6e52 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Wed, 14 Jan 2026 03:41:56 +0700 Subject: README: describe how the flow of scan command --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index b000448..e4f51d3 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,32 @@ changes the behaviour of apply command. Deleting a line in the report means excluding the file from being processed by "apply" command. +The scan command work in the following way, + +(1) Check the file for SPDX-License-Identifier and SPDX-FileCopyrightText. +If both exist, skip the file. + +(2) For each match-license in the configuration, + +(2.1) If there is a match, record it as "match" and its line number +into the report. + +(2.2) If no match, use the default license from configuration, record it as +"default" with 0 line number in the report. + +(3) For each match-copyright in the configuration, + +(3.1) If there is a match, get the year, author, and contact; and record it +as "match" and its line number into the report. + +If the year is empty, 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. + +(3.2) If there is no match, use default copyright year and text from +configuration, and record as "default" in the report. + ### spdxconv.report file format Each line in the report file is formatted using CSV and has several columns -- cgit v1.3