Skip to content

Commit 538a82e

Browse files
Shen7436lhespress
authored andcommitted
feat: add codespell check
1 parent 3e3b346 commit 538a82e

29 files changed

Lines changed: 85 additions & 45 deletions

File tree

.codespellrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
skip = build,*.drawio,*.svg,*.pdf
3+
ignore-words-list = laf,OT,inout
4+
write-changes = true

.gitlab-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
stages:
2+
- check
23
- build
34
- deploy
45

@@ -166,3 +167,6 @@ push_master_to_github:
166167
# NB: In gitlab 9.x, CI_BUILD_REF was deprecated. New name is CI_COMMIT_REF. If below command suddenly
167168
# generates bash syntax errors, this is probably why.
168169
- eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)
170+
171+
include:
172+
- '.gitlab/ci/pre_commit.yml'

.gitlab/ci/pre_commit.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.check_pre_commit_template:
2+
stage: check
3+
image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.3:1-1
4+
rules:
5+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
6+
script:
7+
- pip install pre-commit
8+
- git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME --depth=1
9+
- git fetch origin $CI_COMMIT_REF_NAME --depth=1
10+
- |
11+
echo "Target branch: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
12+
echo "Source branch: $CI_COMMIT_REF_NAME"
13+
14+
MODIFIED_FILES=$(git diff --name-only origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..origin/$CI_COMMIT_REF_NAME)
15+
echo "Modified files to check:"
16+
echo "$MODIFIED_FILES"
17+
18+
if [ -n "$MODIFIED_FILES" ]; then
19+
CI=true pre-commit run --files $MODIFIED_FILES
20+
else
21+
echo "No modified files to check."
22+
fi
23+
24+
check_pre_commit:
25+
extends:
26+
- .check_pre_commit_template

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/codespell-project/codespell
3+
rev: v2.4.1
4+
hooks:
5+
- id: codespell
6+
args: [--config=.codespellrc]

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Features:
1515
- Add bind error event for timeout, rssi and bindlist size.
1616
- Reduce the number of NVS operations. [#123](https://github.com/espressif/esp-now/pull/123)
1717
- Use separate cache to store security keys, one for encrypt, the other for decrypt.
18-
- Announce securiy handshake info of initiator to responder.
18+
- Announce security handshake info of initiator to responder.
1919

2020
# v2.5.1
2121

@@ -33,7 +33,7 @@ Fixed:
3333

3434
Features:
3535
- Control attribute is mostly meaningless. [#82](https://github.com/espressif/esp-now/issues/82)
36-
- Control functionality improvments. [#84](https://github.com/espressif/esp-now/issues/84)
36+
- Control functionality improvements. [#84](https://github.com/espressif/esp-now/issues/84)
3737
- Update document for match the components. [#85](https://github.com/espressif/esp-now/issues/85)
3838
- Support USB Serial JTAG and USB CDC console. [#86](https://github.com/espressif/esp-now/issues/86)
3939
- Add Kconfig options for esp-now OTA. [#94](https://github.com/espressif/esp-now/issues/94)
@@ -46,7 +46,7 @@ Fixed:
4646
- Fix provisioning doesn't work when enable CONFIG_ESPNOW_APP_SECURITY.[#103](https://github.com/espressif/esp-now/issues/103)
4747
- Fix an issue of init error after deinit.[#104](https://github.com/espressif/esp-now/issues/104)
4848
- Fix Wrong channel logged on send error. [#106](https://github.com/espressif/esp-now/issues/106)
49-
- Fix Some API is deprecated which cause compile waring. [#111](https://github.com/espressif/esp-now/issues/111)
49+
- Fix Some API is deprecated which cause compile warning. [#111](https://github.com/espressif/esp-now/issues/111)
5050

5151
# v2.4.0
5252

@@ -80,7 +80,7 @@ Features:
8080

8181
Fixed:
8282
- Fix the bug with bindlist cleanup when unbinding.
83-
- Fix compile issue when enbale Anti-rollback option.
83+
- Fix compile issue when enable Anti-rollback option.
8484
- Fix the bug that prevents sending clear data when security is enabled. [#63](https://github.com/espressif/esp-now/issues/63)
8585
- Fix the bug where ESPNOW_INIT_CONFIG_DEFAULT does not match its declaration in C++. [#65](https://github.com/espressif/esp-now/issues/65)
8686

Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ menu "ESP-NOW Configuration"
236236
default y
237237
help
238238
Linenoise line editing library provides functions to save and load
239-
command history. If this option is enabled, initalizes a FAT filesystem
239+
command history. If this option is enabled, initializes a FAT filesystem
240240
and uses it to store command history.
241241
endmenu
242242

@@ -248,7 +248,7 @@ menu "ESP-NOW Configuration"
248248
Store log info partition label.
249249

250250
config ESPNOW_DEBUG_LOG_PARTITION_LABEL_NVS
251-
string "The partition lable used to store log status"
251+
string "The partition label used to store log status"
252252
default "log_status"
253253
help
254254
Store log status partition label.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ Executing action: create-project-from-example
4545
CMakeLists.txt not found in project directory /home/username
4646
```
4747

48-
A1. This is because an older version packege manager was used, please run `pip install -U idf-component-manager` in ESP-IDF environment to update.
48+
A1. This is because an older version package manager was used, please run `pip install -U idf-component-manager` in ESP-IDF environment to update.

User_Guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ There are two roles defined in ESP-NOW according to the data flow, initiator and
2727

2828
### IDF Version
2929

30-
The following table shows the ESP-IDF versions supported by ESP-NOW at the current time. The lable ![alt text](docs/_static/yes-checkm.png "supported") means supported, and the lable ![alt text](docs/_static/no-icon.png) means not supported.
30+
The following table shows the ESP-IDF versions supported by ESP-NOW at the current time. The label ![alt text](docs/_static/yes-checkm.png "supported") means supported, and the label ![alt text](docs/_static/no-icon.png) means not supported.
3131

3232
The ESP-IDF master branch is marked as not supported because the major feature changes it has introduced may cause conflicts with ESP-NOW. Yet, the ESP-NOW examples not affected by those feature changes can still run correctly on the IDF master branch.
3333

@@ -116,7 +116,7 @@ ESP-NOW can be used to receive the running log for debugging. It can be used in
116116

117117
ESP-NOW can protect the data security with ECDH and AES128-CCM.
118118

119-
1. **Quick Configuration**: 16 devices can be configurated in 5 seconds.
119+
1. **Quick Configuration**: 16 devices can be configured in 5 seconds.
120120
2. **Multiple Devices Handshake**: ESP-NOW initiator can support multiple devices handshake at same time.
121121
3. **Safety**:
122122
- ECDH and Proof of Possession (PoP) string used to authorize session and derive shared key

examples/coin_cell_demo/switch/docs/button_in_matter_bridging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ A few configurations are applied to try to speed up the execution and reduce the
4444
* `CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y`: Let bootloader logging level to none.
4545
* `CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y`: Set bootloader optimization level to -O2.
4646
* `CONFIG_COMPILER_OPTIMIZATION_PERF=y`: Set application optimization level to -O2.
47-
* `CONFIG_ESP_PHY_RF_CAL_NONE=y`: This disables the RF calibration during bootup.
47+
* `CONFIG_ESP_PHY_RF_CAL_NONE=y`: This disables the RF calibration during boot-up.
4848
* `CONFIG_LOG_DEFAULT_LEVEL_NONE=y`: This disables all logs.
4949
* `CONFIG_ESPNOW_LIGHT_SLEEP=y`: This asks the device to enter light sleep before starting the next transmission.
5050
* `CONFIG_ESPNOW_LIGHT_SLEEP_DURATION`: After ```CONFIG_ESPNOW_LIGHT_SLEEP``` is enabled, the duration can be set with this configuration. Default is 30ms.
@@ -271,7 +271,7 @@ In actual usage, usually we will only bind once and will not unbind the coin cel
271271

272272
> However, note that with V1 hardware, for each bind operation, the button needs to send one extra control, and for each unbind, the button needs to send one extra control and one extra bind.
273273
274-
In control tranmission, we will calculate the power consumption for both one time transmission and three-time transmission. We will also calculate the power consumption for channel switching. The numbers will be taken from the measurements above.
274+
In control transmission, we will calculate the power consumption for both one time transmission and three-time transmission. We will also calculate the power consumption for channel switching. The numbers will be taken from the measurements above.
275275

276276
In battery life calculation, we assume the coin cell button will be pressed 50 times a day, and there will be 1 channel switching per day.
277277

examples/ota/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ python -m http.server 8070
3232
While the server is running, you may open this `http://localhost:8070/` in browse to check the build directory.
3333

3434
> Note:
35-
1. If there are firewall softwares that prevent any access to the port 8070, please grant the access while the example is running.
35+
1. If there are firewall software that prevent any access to the port 8070, please grant the access while the example is running.
3636

3737
### Step 3: Build & Flash & Run the responders
3838

@@ -45,7 +45,7 @@ Set following configurations under `Example Connection Configuration` Options:
4545
Set following configurations under `Example Configuration` Options:
4646
* Set `ESP-NOW mode` to `Responder Mode`
4747

48-
When downloading the flash, it's recommend to use `erase_flash` to erase the entire flash memory (all the remaining data in ota_data partition will be deleted as well) for the first time, and then write the followings via a serial port:
48+
When downloading the flash, it's recommend to use `erase_flash` to erase the entire flash memory (all the remaining data in ota_data partition will be deleted as well) for the first time, and then write the following via a serial port:
4949

5050
```shell
5151
idf.py erase_flash flash
@@ -78,7 +78,7 @@ for e.g,
7878
http://192.168.0.3:8070/hello-world.bin
7979
```
8080

81-
When downloading the flash, it's recommend to use `erase_flash` to erase the entire flash memory (all the remaining data in ota_data partition will be deleted as well) for the first time, and then write the followings via a serial port:
81+
When downloading the flash, it's recommend to use `erase_flash` to erase the entire flash memory (all the remaining data in ota_data partition will be deleted as well) for the first time, and then write the following via a serial port:
8282

8383
```shell
8484
idf.py erase_flash flash

0 commit comments

Comments
 (0)