From e5a023cc2aa1aec320574abd92eb9ea24846e0b5 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Wed, 14 Jan 2026 16:55:40 +0700 Subject: README: rewording and update header level on commands --- README.md | 61 +++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1fdf810..436b8ab 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ copyright as stated. User then can repeat edit "spdxconv.cfg", "scan" and "apply" command multiple times, until they satisfied with the result. -## init command +### init command The first thing to do is to generate the configuration file using @@ -139,7 +139,7 @@ For quick references here are several rules that you need to be aware of, The next subsection explain the content of configuration file and how it affect the program during scan and apply. -### default section +#### default section This section define the default license identifier, year, and copyright text to be inserted into file if no `match-license` or `match-copyright` found in @@ -157,7 +157,7 @@ example, "2000-2026"), or list of year with comma separated (for example, The `file_copyright_text` set the default author and contact in `SPDX-FileCopyrightText`. -For example, "John Doe ". +For example, "John Doe \". You should fill the `license_identifier`, `copyright_year`, and `file_copyright_text` before continue running the program. @@ -183,7 +183,10 @@ 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 directly. -### match-license section +If the file name does not match with one of the "match-file-pattern" then +the file will be flagged as "unknown". + +#### match-license section @@ -195,7 +198,7 @@ line that match with "SPDX-License-Identifier:". If there is a match, at the top or bottom, the scan will stop and continue for processing copyright. -If there is no match it will search for a line that match with "pattern" +If no match it will search for a line that match with "pattern" regular expression. If there is a line that match with it, the value in "match-license::license_identifier" will replace the @@ -206,7 +209,7 @@ search for the pattern before and after the matched line and delete it. The "delete_line_before" and "delete_line_after" can be defined zero or multiple times. -### match-copyright section +#### match-copyright section The match-copyright section define the pattern to match with old copyright text. @@ -218,30 +221,30 @@ the date of the first commit in history of the file using the Source Code Management (SCM). In git SCM, it will run "git log --follow file". -Example, given the following old copyright text, +For example, given the following old copyright text, ``` -Copyright 2022, John Doe . All rights reserved. +// Copyright 2022, John Doe . All rights reserved. ``` we can capture the year, author, and contact using the following regex, ``` -^(//+|#+|/\\*+|