Skip to content

Commit

Permalink
Merge pull request #15 from espressif/feat/ci_add_copyright_check
Browse files Browse the repository at this point in the history
CI: Add copyright license check
  • Loading branch information
tore-espressif authored Feb 13, 2024
2 parents 1415c25 + 705e4b8 commit a0eae4d
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
43 changes: 43 additions & 0 deletions check_copyright_config.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion device/esp_tinyusb/include/tusb_config.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion device/esp_tinyusb/test/test_bvalid_sig.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion device/esp_tinyusb/test/test_esp_tinyusb.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion host/class/cdc/usb_host_cdc_acm/test/test_cdc_acm_host.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion host/class/cdc/usb_host_cdc_acm/test/usb_device.c
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion host/class/hid/usb_host_hid/test/hid_mock_device.c
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion host/class/hid/usb_host_hid/test/hid_mock_device.h
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion host/class/msc/usb_host_msc/test/msc_device.c
Original file line number Diff line number Diff line change
@@ -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
*/


Expand Down
2 changes: 1 addition & 1 deletion host/class/msc/usb_host_msc/test/test_common.h
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion host/class/msc/usb_host_msc/test/test_msc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion host/class/uvc/usb_host_uvc/include/libuvc_adapter.h
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion host/class/uvc/usb_host_uvc/include/libuvc_helper.h
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion host/class/uvc/usb_host_uvc/private_include/descriptor.h
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion host/class/uvc/usb_host_uvc/private_include/libusb.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion host/class/uvc/usb_host_uvc/src/descriptor.c
Original file line number Diff line number Diff line change
@@ -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 <string.h>
Expand Down
2 changes: 1 addition & 1 deletion host/class/uvc/usb_host_uvc/test/test_uvc.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test_app/pytest_usb_device.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion test_app/pytest_usb_host.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit a0eae4d

Please sign in to comment.