Skip to content

Commit

Permalink
Add pre-commit for copyright and fixed copyright in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
espzav authored Jul 24, 2023
1 parent 5f32a6d commit 1452b26
Show file tree
Hide file tree
Showing 61 changed files with 174 additions and 130 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ repos:
types_or: [c, c++]
args: ['--fix=lf']
description: Forces to replace line ending by the UNIX 'lf' character

- repo: https://github.com/espressif/check-copyright/
rev: v1.0.3
hooks:
- id: check-copyright
args: ['--config', 'check_copyright_config.yaml']
2 changes: 2 additions & 0 deletions SquareLine/gen.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import sys
import os
import json
Expand Down
45 changes: 45 additions & 0 deletions check_copyright_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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
examples_and_unit_tests:
include:
- 'examples/'
- 'components/**/test/**'
- 'components/**/test_apps/**'
- 'test_app/'
- 'SquareLine/'
allowed_licenses:
- Apache-2.0
- Unlicense
- CC0-1.0
license_for_new_files: CC0-1.0

ignore: # You can also select ignoring files here
perform_check: no # Don't check files from that block
include:
- docu/
5 changes: 5 additions & 0 deletions components/ssd1306/ssd1306_fonts.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "ssd1306_fonts.h"

const uint8_t c_chFont1206[95][12] = { {
Expand Down
2 changes: 1 addition & 1 deletion esp-box-lite/esp-box-lite.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 "driver/gpio.h"
Expand Down
2 changes: 1 addition & 1 deletion esp-box-lite/include/bsp/display.h
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
*/

/**
Expand Down
22 changes: 11 additions & 11 deletions esp-box-lite/include/bsp/esp-box-lite.h
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
*/

/**
Expand Down Expand Up @@ -56,15 +56,15 @@
* Power pins are on 3.3V.
*
* Double PMOD Connectors on ESP-BOX-Lite are labeled as follows:
* ┌────────────┐
* | IO1 IO5
* | IO2 IO6
* | IO3 IO7
* | IO4 IO8
* ├────────────┤
* | GND GND
* | 3V3 3V3
* └────────────┘
* |------------|
* | IO1 IO5 |
* | IO2 IO6 |
* | IO3 IO7 |
* | IO4 IO8 |
* |------------|
* | GND GND |
* | 3V3 3V3 |
* |------------|
*/
#define BSP_PMOD1_IO1 GPIO_NUM_42
#define BSP_PMOD1_IO2 GPIO_NUM_21
Expand Down
2 changes: 1 addition & 1 deletion esp-box-lite/include/bsp/esp-bsp.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp-box-lite/priv_include/bsp_err_check.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp-box/esp-box.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 "driver/gpio.h"
Expand Down
2 changes: 1 addition & 1 deletion esp-box/include/bsp/display.h
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
*/

/**
Expand Down
22 changes: 11 additions & 11 deletions esp-box/include/bsp/esp-box.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
* SPDX-License-Identifier: Apache-2.0
*/

/**
Expand Down Expand Up @@ -57,15 +57,15 @@
* Power pins are on 3.3V.
*
* Double PMOD Connectors on ESP-BOX are labeled as follows:
* ┌────────────┐
* | IO1 IO5
* | IO2 IO6
* | IO3 IO7
* | IO4 IO8
* ├────────────┤
* | GND GND
* | 3V3 3V3
* └────────────┘
* |------------|
* | IO1 IO5 |
* | IO2 IO6 |
* | IO3 IO7 |
* | IO4 IO8 |
* |------------|
* | GND GND |
* | 3V3 3V3 |
* |------------|
*/
#define BSP_PMOD1_IO1 GPIO_NUM_42
#define BSP_PMOD1_IO2 GPIO_NUM_21
Expand Down
2 changes: 1 addition & 1 deletion esp-box/include/bsp/esp-bsp.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 esp-box/include/bsp/touch.h
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
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion esp-box/priv_include/bsp_err_check.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: CC0-1.0
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once
Expand Down
18 changes: 5 additions & 13 deletions esp32_azure_iot_kit/esp32_azure_iot_kit.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
// Copyright 2015-2023 Espressif Systems (Shanghai) CO LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "bsp/esp32_azure_iot_kit.h"
#include "esp_vfs_fat.h"
Expand Down
2 changes: 1 addition & 1 deletion esp32_azure_iot_kit/include/bsp/esp-bsp.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 esp32_azure_iot_kit/include/bsp/esp32_azure_iot_kit.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: CC0-1.0
* SPDX-License-Identifier: Apache-2.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion esp32_azure_iot_kit/priv_include/bsp_err_check.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: CC0-1.0
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_c3_lcdkit/include/bsp/display.h
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
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion esp32_c3_lcdkit/include/bsp/esp-bsp.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_c3_lcdkit/priv_include/bsp_err_check.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_lyrat/esp32_lyrat.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 "driver/gpio.h"
Expand Down
2 changes: 1 addition & 1 deletion esp32_lyrat/esp32_lyrat_idf4.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 "esp_err.h"
Expand Down
2 changes: 1 addition & 1 deletion esp32_lyrat/esp32_lyrat_idf5.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 "esp_err.h"
Expand Down
2 changes: 1 addition & 1 deletion esp32_lyrat/include/bsp/esp-bsp.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_lyrat/include/bsp/esp32_lyrat.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_lyrat/priv_include/bsp_err_check.h
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
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_s2_kaluga_kit/include/bsp/display.h
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
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion esp32_s2_kaluga_kit/include/bsp/esp-bsp.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 esp32_s2_kaluga_kit/priv_include/bsp_err_check.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: CC0-1.0
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion esp32_s3_eye/include/bsp/display.h
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
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion esp32_s3_eye/include/bsp/esp-bsp.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
Loading

0 comments on commit 1452b26

Please sign in to comment.