0
Files
src/tools/PRESUBMIT.py
Andrew Mellen a2d7186881 licenses.py SPDX format output
This change adds functionality to the licenses.py script for
outputting licensing info in SPDX format, instead of concatenating
every license file text together.

As written, the script still defaults to the existing formatting, so no
change in functionality should be expected until command line flags are
set (specifically --format spdx).

Bug: b:248101373
Test: python3 tools/licenses.py --format spdx --spdx-doc-name 'chromium' --gn-target '//components/cronet:cronet' --gn-out-dir './out/Default' license_file 'LICENSE.spdx'
Change-Id: I7f79e2309b4f28a5c06bd820168d054e6e48ec63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3950177
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Mellen <amellen@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1069863}
2022-11-10 19:01:24 +00:00

22 lines
698 B
Python

# Copyright 2022 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
PRESUBMIT_VERSION = '2.0.0'
# This line is 'magic' in that git-cl looks for it to decide whether to
# use Python3 instead of Python2 when running the code in this file.
USE_PYTHON3 = True
def CheckPythonTests(input_api, output_api):
return input_api.RunTests(
input_api.canned_checks.GetUnitTestsInDirectory(
input_api,
output_api,
input_api.PresubmitLocalPath(),
files_to_check=[r'.+_(?:unit)?test\.py$'],
run_on_python2=False,
run_on_python3=True,
skip_shebang_check=True))