diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ac75174..6b6edfd1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,12 @@ repos: - id: codespell args: [-w, "--ignore-words=codespell-ignore-list"] +- repo: https://github.com/espressif/check-copyright/ + rev: v1.0.3 + hooks: + - id: check-copyright + args: ['-r', '--config', 'check_copyright_config.yaml'] + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: diff --git a/check_copyright_config.yaml b/check_copyright_config.yaml new file mode 100644 index 00000000..e3829f27 --- /dev/null +++ b/check_copyright_config.yaml @@ -0,0 +1,43 @@ +DEFAULT: + perform_check: yes # should the check be performed? + # Sections setting this to 'no' don't need to include any other options as they are ignored + # When a file is using a section with the option set to 'no', no checks are performed. + + # what licenses (or license expressions) are allowed for files in this section + # when setting this option in a section, you need to list all the allowed licenses + allowed_licenses: + - Apache-2.0 + license_for_new_files: Apache-2.0 # license to be used when inserting a new copyright notice + new_notice_c: | # notice for new C, CPP, H, HPP and LD files + /* + * SPDX-FileCopyrightText: {years} Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: {license} + */ + new_notice_python: | # notice for new python files + # SPDX-FileCopyrightText: {years} Espressif Systems (Shanghai) CO LTD + # SPDX-License-Identifier: {license} + + # comment lines matching: + # SPDX-FileCopyrightText: year[-year] Espressif Systems + # or + # SPDX-FileContributor: year[-year] Espressif Systems + # are replaced with this template prefixed with the correct comment notation (# or // or *) and SPDX- notation + espressif_copyright: '{years} Espressif Systems (Shanghai) CO LTD' + +# You can create your own rules for files or group of files +libuvc: + include: + - 'host/class/uvc/usb_host_uvc/**' + allowed_licenses: + - Apache-2.0 + - LGPL-2.1-or-later + license_for_new_files: Apache-2.0 + +tinyusb: + include: + - ' device/esp_tinyusb/**' + allowed_licenses: + - Apache-2.0 + - MIT + license_for_new_files: Apache-2.0 diff --git a/device/esp_tinyusb/include/tusb_config.h b/device/esp_tinyusb/include/tusb_config.h index fbca2be4..adcea7c3 100644 --- a/device/esp_tinyusb/include/tusb_config.h +++ b/device/esp_tinyusb/include/tusb_config.h @@ -1,5 +1,7 @@ /* - * The MIT License (MIT) + * SPDX-FileCopyrightText: 2019 Ha Thach (tinyusb.org), + * SPDX-FileContributor: 2020 Espressif Systems (Shanghai) CO LTD + * SPDX-License-Identifier: MIT * * Copyright (c) 2019 Ha Thach (tinyusb.org), * Additions Copyright (c) 2020, Espressif Systems (Shanghai) PTE LTD diff --git a/device/esp_tinyusb/test/test_bvalid_sig.c b/device/esp_tinyusb/test/test_bvalid_sig.c index 7be595f6..e1d8757b 100644 --- a/device/esp_tinyusb/test/test_bvalid_sig.c +++ b/device/esp_tinyusb/test/test_bvalid_sig.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/soc_caps.h" diff --git a/device/esp_tinyusb/test/test_esp_tinyusb.c b/device/esp_tinyusb/test/test_esp_tinyusb.c index 99370ef0..de8a7ea6 100644 --- a/device/esp_tinyusb/test/test_esp_tinyusb.c +++ b/device/esp_tinyusb/test/test_esp_tinyusb.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/soc_caps.h" diff --git a/host/class/cdc/usb_host_cdc_acm/test/test_cdc_acm_host.c b/host/class/cdc/usb_host_cdc_acm/test/test_cdc_acm_host.c index 52301e15..5893080d 100644 --- a/host/class/cdc/usb_host_cdc_acm/test/test_cdc_acm_host.c +++ b/host/class/cdc/usb_host_cdc_acm/test/test_cdc_acm_host.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/soc_caps.h" diff --git a/host/class/cdc/usb_host_cdc_acm/test/usb_device.c b/host/class/cdc/usb_host_cdc_acm/test/usb_device.c index 74793ed4..4cdfb9dc 100644 --- a/host/class/cdc/usb_host_cdc_acm/test/usb_device.c +++ b/host/class/cdc/usb_host_cdc_acm/test/usb_device.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/host/class/hid/usb_host_hid/test/hid_mock_device.c b/host/class/hid/usb_host_hid/test/hid_mock_device.c index da47f582..16e6ed65 100644 --- a/host/class/hid/usb_host_hid/test/hid_mock_device.c +++ b/host/class/hid/usb_host_hid/test/hid_mock_device.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/host/class/hid/usb_host_hid/test/hid_mock_device.h b/host/class/hid/usb_host_hid/test/hid_mock_device.h index bdea9a20..95a70874 100644 --- a/host/class/hid/usb_host_hid/test/hid_mock_device.h +++ b/host/class/hid/usb_host_hid/test/hid_mock_device.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ typedef enum { diff --git a/host/class/msc/usb_host_msc/test/msc_device.c b/host/class/msc/usb_host_msc/test/msc_device.c index 5de72858..952ae10f 100644 --- a/host/class/msc/usb_host_msc/test/msc_device.c +++ b/host/class/msc/usb_host_msc/test/msc_device.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ diff --git a/host/class/msc/usb_host_msc/test/test_common.h b/host/class/msc/usb_host_msc/test/test_common.h index 25fd558b..20a18160 100644 --- a/host/class/msc/usb_host_msc/test/test_common.h +++ b/host/class/msc/usb_host_msc/test/test_common.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/host/class/msc/usb_host_msc/test/test_msc.c b/host/class/msc/usb_host_msc/test/test_msc.c index 8f0e83fa..bdf4048f 100644 --- a/host/class/msc/usb_host_msc/test/test_msc.c +++ b/host/class/msc/usb_host_msc/test/test_msc.c @@ -2,7 +2,7 @@ /* * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include "unity.h" diff --git a/host/class/uvc/usb_host_uvc/include/libuvc_adapter.h b/host/class/uvc/usb_host_uvc/include/libuvc_adapter.h index e2e91d80..afb3390c 100644 --- a/host/class/uvc/usb_host_uvc/include/libuvc_adapter.h +++ b/host/class/uvc/usb_host_uvc/include/libuvc_adapter.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/host/class/uvc/usb_host_uvc/include/libuvc_helper.h b/host/class/uvc/usb_host_uvc/include/libuvc_helper.h index f2244bd4..c362bbc9 100644 --- a/host/class/uvc/usb_host_uvc/include/libuvc_helper.h +++ b/host/class/uvc/usb_host_uvc/include/libuvc_helper.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/host/class/uvc/usb_host_uvc/private_include/descriptor.h b/host/class/uvc/usb_host_uvc/private_include/descriptor.h index 9c4f40d8..921748d2 100644 --- a/host/class/uvc/usb_host_uvc/private_include/descriptor.h +++ b/host/class/uvc/usb_host_uvc/private_include/descriptor.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/host/class/uvc/usb_host_uvc/private_include/libusb.h b/host/class/uvc/usb_host_uvc/private_include/libusb.h index 8006a7f0..454e09a0 100644 --- a/host/class/uvc/usb_host_uvc/private_include/libusb.h +++ b/host/class/uvc/usb_host_uvc/private_include/libusb.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/host/class/uvc/usb_host_uvc/src/descriptor.c b/host/class/uvc/usb_host_uvc/src/descriptor.c index 1c02cb7f..531fbd3c 100644 --- a/host/class/uvc/usb_host_uvc/src/descriptor.c +++ b/host/class/uvc/usb_host_uvc/src/descriptor.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/host/class/uvc/usb_host_uvc/test/test_uvc.c b/host/class/uvc/usb_host_uvc/test/test_uvc.c index d6f61f75..c8f4ccbe 100644 --- a/host/class/uvc/usb_host_uvc/test/test_uvc.c +++ b/host/class/uvc/usb_host_uvc/test/test_uvc.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: CC0-1.0 + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/soc_caps.h" diff --git a/test_app/pytest_usb_device.py b/test_app/pytest_usb_device.py index 9c77d14d..0ae37967 100644 --- a/test_app/pytest_usb_device.py +++ b/test_app/pytest_usb_device.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD -# SPDX-License-Identifier: CC0-1.0 +# SPDX-License-Identifier: Apache-2.0 from typing import Tuple diff --git a/test_app/pytest_usb_host.py b/test_app/pytest_usb_host.py index f632a995..e5ec922f 100644 --- a/test_app/pytest_usb_host.py +++ b/test_app/pytest_usb_host.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD -# SPDX-License-Identifier: CC0-1.0 +# SPDX-License-Identifier: Apache-2.0 from typing import Tuple