-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
213 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
DEFAULT: | ||
# These formatting options will be used by default. | ||
# If you are modifying this, update tools/format.sh as well! | ||
options: "--style=otbs --attach-namespaces --attach-classes --indent=spaces=4 --convert-tabs --align-reference=name --keep-one-line-statements --pad-header --pad-oper --unpad-paren --max-continuation-indent=120" | ||
|
||
submodules: | ||
# Don't format the code in submodules | ||
check: false | ||
include: | ||
- "/components/bootloader/subproject/components/micro-ecc/micro-ecc/" | ||
- "/components/bt/controller/lib_esp32/" | ||
- "/components/bt/controller/lib_esp32c2/esp32c2-bt-lib/" | ||
- "/components/bt/controller/lib_esp32c3_family/" | ||
- "/components/bt/controller/lib_esp32c6/esp32c6-bt-lib/" | ||
- "/components/bt/controller/lib_esp32h2/esp32h2-bt-lib/" | ||
- "/components/bt/host/nimble/nimble/" | ||
- "/components/cmock/CMock/" | ||
- "/components/esp_coex/lib/" | ||
- "/components/esp_phy/lib/" | ||
- "/components/esp_wifi/lib/" | ||
- "/components/heap/tlsf/" | ||
- "/components/ieee802154/lib/" | ||
- "/components/json/cJSON/" | ||
- "/components/lwip/lwip/" | ||
- "/components/mbedtls/mbedtls/" | ||
- "/components/mqtt/esp-mqtt/" | ||
- "/components/openthread/lib/" | ||
- "/components/openthread/openthread/" | ||
- "/components/protobuf-c/protobuf-c/" | ||
- "/components/spiffs/spiffs/" | ||
- "/components/unity/unity/" | ||
|
||
components_not_formatted_temporary: | ||
# Formatting in these components isn't checked yet. | ||
# For each of these components, decide whether it should be formatted or not. | ||
# 1. If yes, format the code and remove the component from the exclude list. | ||
# Add special rules for upstream source files, if necessary. | ||
# To reformat the files: | ||
# - Remove the directory from this exclude list | ||
# - Run 'git add .astyle-rules.yml' | ||
# - Run 'pre-commit run --all-files' | ||
# 2. If no, move it to 'components_not_formatted_permanent' section below. | ||
check: false | ||
include: | ||
- "/components/app_trace/" | ||
- "/components/app_update/" | ||
- "/components/bootloader_support/" | ||
- "/components/bootloader/" | ||
- "/components/bt/" | ||
- "/components/cmock/" | ||
- "/components/console/" | ||
- "/components/cxx/" | ||
- "/components/driver/" | ||
- "/components/efuse/" | ||
- "/components/esp_adc/" | ||
- "/components/esp_app_format/" | ||
- "/components/esp_bootloader_format/" | ||
- "/components/esp_coex/" | ||
- "/components/esp_common/" | ||
- "/components/esp_eth/" | ||
- "/components/esp_event/" | ||
- "/components/esp_gdbstub/" | ||
- "/components/esp_hid/" | ||
- "/components/esp_http_client/" | ||
- "/components/esp_http_server/" | ||
- "/components/esp_https_ota/" | ||
- "/components/esp_https_server/" | ||
- "/components/esp_hw_support/" | ||
- "/components/esp_lcd/" | ||
- "/components/esp_local_ctrl/" | ||
- "/components/esp_mm/" | ||
- "/components/esp_netif/" | ||
- "/components/esp_partition/" | ||
- "/components/esp_phy/" | ||
- "/components/esp_pm/" | ||
- "/components/esp_psram/" | ||
- "/components/esp_ringbuf/" | ||
- "/components/esp_rom/" | ||
- "/components/esp_system/" | ||
- "/components/esp_timer/" | ||
- "/components/esp_wifi/" | ||
- "/components/esp-tls/" | ||
- "/components/espcoredump/" | ||
- "/components/esptool_py/" | ||
- "/components/fatfs/" | ||
- "/components/freertos/" | ||
- "/components/hal/" | ||
- "/components/heap/" | ||
- "/components/idf_test/" | ||
- "/components/ieee802154/" | ||
- "/components/json/" | ||
- "/components/linux/" | ||
- "/components/log/" | ||
- "/components/lwip/" | ||
- "/components/mbedtls/" | ||
- "/components/mqtt/" | ||
- "/components/newlib/" | ||
- "/components/nvs_flash/" | ||
- "/components/nvs_sec_provider/" | ||
- "/components/openthread/" | ||
- "/components/partition_table/" | ||
- "/components/perfmon/" | ||
- "/components/protobuf-c/" | ||
- "/components/protocomm/" | ||
- "/components/pthread/" | ||
- "/components/riscv/" | ||
- "/components/sdmmc/" | ||
- "/components/soc/" | ||
- "/components/spi_flash/" | ||
- "/components/spiffs/" | ||
- "/components/tcp_transport/" | ||
- "/components/touch_element/" | ||
- "/components/ulp/" | ||
- "/components/unity/" | ||
- "/components/usb/" | ||
- "/components/vfs/" | ||
- "/components/wear_levelling/" | ||
- "/components/wifi_provisioning/" | ||
- "/components/wpa_supplicant/" | ||
- "/components/xtensa/" | ||
- "/examples/bluetooth/" | ||
- "/examples/build_system/" | ||
- "/examples/common_components/" | ||
- "/examples/custom_bootloader/" | ||
- "/examples/cxx/" | ||
- "/examples/ethernet/" | ||
- "/examples/get-started/" | ||
- "/examples/mesh/" | ||
- "/examples/network/" | ||
- "/examples/openthread/" | ||
- "/examples/peripherals/" | ||
- "/examples/phy/" | ||
- "/examples/protocols/" | ||
- "/examples/provisioning/" | ||
- "/examples/security/" | ||
- "/examples/storage/" | ||
- "/examples/system/" | ||
- "/examples/wifi/" | ||
- "/examples/zigbee/" | ||
- "/tools/esp_app_trace/test/" | ||
- "/tools/mocks/" | ||
- "/tools/test_apps/" | ||
- "/tools/unit-test-app/" | ||
|
||
components_not_formatted_permanent: | ||
# Files which are not supposed to be formatted. | ||
# Typically, these are: | ||
# - Upstream source code we don't want to modify | ||
# - Generated files | ||
check: false | ||
include: | ||
# Xtensa header files (generated) | ||
- "/components/xtensa/esp32/" | ||
- "/components/xtensa/esp32s2/" | ||
- "/components/xtensa/esp32s3/" | ||
- "/components/xtensa/include/xtensa/" | ||
# FAT FS (upstream source code) | ||
- "/components/fatfs/src/" | ||
# Nginx HTTP parser (upstream source code) | ||
- "/components/http_parser/" | ||
# Argtable (upstream source code) | ||
- "/components/console/argtable3/" | ||
# Linenoise (upstream source code) | ||
- "/components/console/linenoise/" | ||
# Catch (upstream source code) | ||
- "/tools/catch/catch.hpp" | ||
# FreeRTOS kernel files (upstream source code). | ||
- "/components/freertos/FreeRTOS-Kernel/" | ||
- "/components/freertos/FreeRTOS-Kernel-SMP/" | ||
- "/components/freertos/FreeRTOS-Kernel-V10.5.1/" | ||
# Segger SystemView (upstream source code). | ||
# Could also try to find suitable astyle options, instead. | ||
- "/components/app_trace/sys_view/Config/" | ||
- "/components/app_trace/sys_view/Sample/" | ||
- "/components/app_trace/sys_view/SEGGER/" | ||
# SoC header files (generated) | ||
- "/components/soc/*/include/soc/" | ||
|
||
docs: | ||
# Docs directory contains some .inc files, which are not C include files | ||
# and should not be formatted | ||
check: false | ||
include: | ||
- "/docs/**/*.inc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
#!/usr/bin/env bash | ||
# Runs astyle with the full set of formatting options | ||
astyle \ | ||
set -euo pipefail | ||
|
||
if [ ! -x "$(command -v astyle_py)" ]; then | ||
echo "astyle_py not found, please install astyle_py:" | ||
echo " pip install -U astyle_py==VERSION" | ||
echo "where VERSION is the same as in .pre-commit-config.yaml." | ||
exit 1 | ||
fi | ||
|
||
# "--astyle-version" here has to be in sync with pre-commit-config.yaml. | ||
# The rest of the options have to be in sync with the default rules in tools/ci/astyle-rules.yml. | ||
astyle_py --astyle-version=3.4.7 \ | ||
--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 \ | ||
--unpad-paren \ | ||
--max-continuation-indent=120 \ | ||
"$@" |