summaryrefslogtreecommitdiffstats
path: root/scripts/spdxcheck.py
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-05-16 12:27:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-18 15:30:49 +0200
commit149d623fbefe67b4c3cfbaae3246f559478aff4c (patch)
treea1153982a1068e9b3b47595e62ffa3c06eb5b7be /scripts/spdxcheck.py
parent0b1e987c56640f6b3e2e39db973e823ce1d01417 (diff)
downloadlinux-149d623fbefe67b4c3cfbaae3246f559478aff4c.tar.bz2
scripts/spdxcheck: Add percentage to statistics
Files checked: 75856 Lines checked: 294516 Files with SPDX: 59410 78% Files with errors: 0 Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/spdxcheck.py')
-rwxr-xr-xscripts/spdxcheck.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
index f3be8ed54f6d..c6ff37e935f5 100755
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -285,7 +285,9 @@ if __name__ == '__main__':
sys.stderr.write('\n')
sys.stderr.write('Files checked: %12d\n' %parser.checked)
sys.stderr.write('Lines checked: %12d\n' %parser.lines_checked)
- sys.stderr.write('Files with SPDX: %12d\n' %parser.spdx_valid)
+ if parser.checked:
+ pc = int(100 * parser.spdx_valid / parser.checked)
+ sys.stderr.write('Files with SPDX: %12d %3d%%\n' %(parser.spdx_valid, pc))
sys.stderr.write('Files with errors: %12d\n' %parser.spdx_errors)
sys.exit(0)