Skip to content

Commit 8899063

Browse files
Merge pull request #217 from espressif/chore/esp_idf_pre_commit_all_files
chore: run esp-idf pre-commit on all files - astyle_py: max-continuation-indent - kconfig check pre-commit - cmake list linter
2 parents 2c7f0d7 + 258f76d commit 8899063

File tree

34 files changed

+163
-155
lines changed

34 files changed

+163
-155
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ repos:
33
rev: v1.0.5
44
hooks:
55
- id: astyle_py
6-
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper']
6+
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper', '--max-continuation-indent=120']
77

88
- repo: https://github.com/codespell-project/codespell
99
rev: v2.2.6
@@ -29,3 +29,21 @@ repos:
2929
args: ['--fix=lf']
3030
description: Forces to replace line ending by the UNIX 'lf' character
3131
exclude: '.*\.uxf'
32+
- id: check-yaml
33+
34+
- repo: https://github.com/espressif/esp-idf-kconfig.git
35+
rev: v2.5.0
36+
hooks:
37+
- id: check-kconfig-files
38+
- id: check-deprecated-kconfig-options
39+
40+
- repo: local
41+
hooks:
42+
- id: cmake-lint
43+
name: Check CMake Files Format
44+
entry: cmakelint --linelength=120 --spaces=4 --filter=-whitespace/indent
45+
language: python
46+
additional_dependencies:
47+
- cmakelint==1.4.1
48+
files: 'CMakeLists.txt$|\.cmake$'
49+
exclude: '\/third_party\/'

device/esp_tinyusb/Kconfig

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,22 @@ menu "TinyUSB Stack"
188188

189189
menu "TinyUSB FAT Format Options"
190190
choice TINYUSB_FAT_FORMAT_TYPE
191-
prompt "FatFS Format Type"
191+
prompt "FatFS Format Type"
192192
default TINYUSB_FAT_FORMAT_ANY
193193
help
194194
Select the FAT filesystem type used when formatting storage.
195195

196-
config TINYUSB_FAT_FORMAT_ANY
197-
bool "FM_ANY - Automatically select from FAT12/FAT16/FAT32"
196+
config TINYUSB_FAT_FORMAT_ANY
197+
bool "FM_ANY - Automatically select from FAT12/FAT16/FAT32"
198198

199-
config TINYUSB_FAT_FORMAT_FAT
200-
bool "FM_FAT - Allow only FAT12/FAT16"
199+
config TINYUSB_FAT_FORMAT_FAT
200+
bool "FM_FAT - Allow only FAT12/FAT16"
201201

202-
config TINYUSB_FAT_FORMAT_FAT32
203-
bool "FM_FAT32 - Force FAT32 only"
202+
config TINYUSB_FAT_FORMAT_FAT32
203+
bool "FM_FAT32 - Force FAT32 only"
204204

205-
config TINYUSB_FAT_FORMAT_EXFAT
206-
bool "FM_EXFAT - Force exFAT (requires exFAT enabled)"
205+
config TINYUSB_FAT_FORMAT_EXFAT
206+
bool "FM_EXFAT - Force exFAT (requires exFAT enabled)"
207207

208208
endchoice
209209

@@ -213,7 +213,7 @@ menu "TinyUSB Stack"
213213
help
214214
Format as a Super Floppy Disk (no partition table).
215215
This is typical for USB flash drives and small volumes.
216-
endmenu
216+
endmenu
217217

218218
endmenu # "Massive Storage Class"
219219

@@ -348,23 +348,23 @@ menu "TinyUSB Stack"
348348
default 3200
349349
range 1600 10240
350350
help
351-
Size of NTB buffers on the reception side. The minimum size used by Linux is 2048 bytes.
352-
NTB buffer size must be significantly larger than the MTU (Maximum Transmission Unit).
353-
The typical default MTU size for Ethernet is 1500 bytes, plus an additional packet overhead.
354-
To improve performance, the NTB buffer size should be large enough to fit multiple MTU-sized
355-
frames in a single NTB buffer and it's length should be multiple of 4.
351+
Size of NTB buffers on the reception side. The minimum size used by Linux is 2048 bytes.
352+
NTB buffer size must be significantly larger than the MTU (Maximum Transmission Unit).
353+
The typical default MTU size for Ethernet is 1500 bytes, plus an additional packet overhead.
354+
To improve performance, the NTB buffer size should be large enough to fit multiple MTU-sized
355+
frames in a single NTB buffer and it's length should be multiple of 4.
356356

357357
config TINYUSB_NCM_IN_NTB_BUFF_MAX_SIZE
358358
int "NCM NTB Buffer size for transmission size"
359359
depends on TINYUSB_NET_MODE_NCM
360360
default 3200
361361
range 1600 10240
362362
help
363-
Size of NTB buffers on the transmission side. The minimum size used by Linux is 2048 bytes.
364-
NTB buffer size must be significantly larger than the MTU (Maximum Transmission Unit).
365-
The typical default MTU size for Ethernet is 1500 bytes, plus an additional packet overhead.
366-
To improve performance, the NTB buffer size should be large enough to fit multiple MTU-sized
367-
frames in a single NTB buffer and it's length should be multiple of 4.
363+
Size of NTB buffers on the transmission side. The minimum size used by Linux is 2048 bytes.
364+
NTB buffer size must be significantly larger than the MTU (Maximum Transmission Unit).
365+
The typical default MTU size for Ethernet is 1500 bytes, plus an additional packet overhead.
366+
To improve performance, the NTB buffer size should be large enough to fit multiple MTU-sized
367+
frames in a single NTB buffer and it's length should be multiple of 4.
368368

369369
endmenu # "Network driver (ECM/NCM/RNDIS)"
370370

device/esp_tinyusb/include/tusb_cdc_acm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -130,8 +130,8 @@ esp_err_t tusb_cdc_acm_deinit(int itf);
130130
* @return esp_err_t - ESP_OK or ESP_ERR_INVALID_ARG
131131
*/
132132
esp_err_t tinyusb_cdcacm_register_callback(tinyusb_cdcacm_itf_t itf,
133-
cdcacm_event_type_t event_type,
134-
tusb_cdcacm_callback_t callback);
133+
cdcacm_event_type_t event_type,
134+
tusb_cdcacm_callback_t callback);
135135

136136
/**
137137
* @brief Unregister a callback invoking on CDC event

device/esp_tinyusb/test/local/libusb_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -62,8 +62,8 @@ int main()
6262
rc = libusb_init(&context);
6363
assert(rc == 0);
6464
libusb_device_handle *dev_handle = libusb_open_device_with_vid_pid(context,
65-
TINYUSB_VENDOR,
66-
TINYUSB_PRODUCT);
65+
TINYUSB_VENDOR,
66+
TINYUSB_PRODUCT);
6767

6868
if (dev_handle != NULL) {
6969
printf("TinyUSB Device has been found\n");

device/esp_tinyusb/test_apps/cdc/sdkconfig.defaults

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ CONFIG_TINYUSB_CDC_COUNT=2
55
CONFIG_TINYUSB_HID_COUNT=0
66

77
# Disable watchdogs, they'd get triggered during unity interactive menu
8-
CONFIG_ESP_INT_WDT=n
9-
CONFIG_ESP_TASK_WDT=n
8+
# CONFIG_ESP_TASK_WDT_INIT is not set
109

1110
# Run-time checks of Heap and Stack
1211
CONFIG_HEAP_POISONING_COMPREHENSIVE=y

device/esp_tinyusb/test_apps/configuration_desc/sdkconfig.defaults

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ CONFIG_TINYUSB_CDC_ENABLED=y
33
CONFIG_TINYUSB_CDC_COUNT=2
44

55
# Disable watchdogs, they'd get triggered during unity interactive menu
6-
CONFIG_ESP_INT_WDT=n
7-
CONFIG_ESP_TASK_WDT=n
6+
# CONFIG_ESP_TASK_WDT_INIT is not set
87

98
# Run-time checks of Heap and Stack
109
CONFIG_HEAP_POISONING_COMPREHENSIVE=y

device/esp_tinyusb/test_apps/dconn_detection/sdkconfig.defaults

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ CONFIG_TINYUSB_CDC_COUNT=0
55
CONFIG_TINYUSB_HID_COUNT=0
66

77
# Disable watchdogs, they'd get triggered during unity interactive menu
8-
CONFIG_ESP_INT_WDT=n
9-
CONFIG_ESP_TASK_WDT=n
8+
# CONFIG_ESP_TASK_WDT_INIT is not set
109

1110
# Run-time checks of Heap and Stack
1211
CONFIG_HEAP_POISONING_COMPREHENSIVE=y

device/esp_tinyusb/test_apps/default_task/sdkconfig.defaults

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ CONFIG_TINYUSB_NO_DEFAULT_TASK=n
33
CONFIG_TINYUSB_INIT_IN_DEFAULT_TASK=n
44

55
# Disable watchdogs, they'd get triggered during unity interactive menu
6-
CONFIG_ESP_INT_WDT=n
7-
CONFIG_ESP_TASK_WDT=n
6+
# CONFIG_ESP_TASK_WDT_INIT is not set
87

98
# Run-time checks of Heap and Stack
109
CONFIG_HEAP_POISONING_COMPREHENSIVE=y

device/esp_tinyusb/test_apps/default_task_with_init/sdkconfig.defaults

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ CONFIG_TINYUSB_NO_DEFAULT_TASK=n
33
CONFIG_TINYUSB_INIT_IN_DEFAULT_TASK=y
44

55
# Disable watchdogs, they'd get triggered during unity interactive menu
6-
CONFIG_ESP_INT_WDT=n
7-
CONFIG_ESP_TASK_WDT=n
6+
# CONFIG_ESP_TASK_WDT_INIT is not set
87

98
# Run-time checks of Heap and Stack
109
CONFIG_HEAP_POISONING_COMPREHENSIVE=y

device/esp_tinyusb/test_apps/external_task/sdkconfig.defaults

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ CONFIG_TINYUSB_NO_DEFAULT_TASK=y
33
CONFIG_TINYUSB_INIT_IN_DEFAULT_TASK=n
44

55
# Disable watchdogs, they'd get triggered during unity interactive menu
6-
CONFIG_ESP_INT_WDT=n
7-
CONFIG_ESP_TASK_WDT=n
6+
# CONFIG_ESP_TASK_WDT_INIT is not set
87

98
# Run-time checks of Heap and Stack
109
CONFIG_HEAP_POISONING_COMPREHENSIVE=y

0 commit comments

Comments
 (0)