Skip to content

Commit

Permalink
Merge branch 'feat/add_codespell_precheck' into 'master'
Browse files Browse the repository at this point in the history
feat(pre_commit): check spell & run all-files

Closes AEG-1598

See merge request ae_group/esp-iot-solution!1012
  • Loading branch information
leeebo committed May 31, 2024
2 parents 095dd70 + 33b23b5 commit c0550db
Show file tree
Hide file tree
Showing 199 changed files with 556 additions and 534 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_approved.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4

- name: Sync approved PRs to internal codebase
uses: espressif/sync-pr-to-gitlab@v1
uses: espressif/sync-pr-to-gitlab@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLAB_URL: ${{ secrets.GITLAB_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/ci/danger.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Extenal DangerJS
# External DangerJS
include:
- project: espressif/shared-ci-dangerjs
ref: master
Expand Down
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ repos:
- id: check-copyright
args: ['--config', 'tools/ci/check_copyright_config.yaml', '--ignore', 'tools/ci/check_copyright_ignore.txt']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: file-contents-sorter
files: 'tools\/ci\/(executable-list\.txt|check_copyright_ignore\.txt)'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: trailing-whitespace
# note: whitespace exclusions use multiline regex, see https://pre-commit.com/#regular-expressions
Expand Down Expand Up @@ -51,7 +51,7 @@ repos:
name: Do not use uppercase letters in the branch name
args: ['--pattern', '^[^A-Z]*[A-Z]']
- repo: https://github.com/espressif/astyle_py.git
rev: v1.0.2
rev: v1.0.5
hooks:
- id: astyle_py
# If you are modifying astyle version, update tools/format.sh as well
Expand All @@ -75,3 +75,8 @@ repos:
hooks:
- id: conventional-precommit-linter
stages: [commit-msg]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: [-w, "--ignore-words=codespell-ignore-list"]
18 changes: 18 additions & 0 deletions codespell-ignore-list
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ALS
ALS
ANS
ans
co-ordinate
co-ordinates
compresed
DOUT
dout
ERRO
ges
gien
MOT
regist
ser
TE
uncompressible
wHeigh
8 changes: 4 additions & 4 deletions components/audio/dac_audio/dac_audio.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -59,7 +59,7 @@ static esp_err_t _i2s_dac_data_scale(uint8_t *d_buff, uint8_t *s_buff, uint32_t
uint32_t j = 0;
switch (g_bits_per_sample) {
case 8: {
DAC_AUDIO_CHECK(g_max_data_size > len, "write lengh exceed max_data_size you set", ESP_ERR_INVALID_ARG);
DAC_AUDIO_CHECK(g_max_data_size > len, "write length exceed max_data_size you set", ESP_ERR_INVALID_ARG);
uint8_t *b8 = (uint8_t *)s_buff;
for (int i = 0; i < len; i++) {
int8_t t = b8[i] ;
Expand All @@ -70,7 +70,7 @@ static esp_err_t _i2s_dac_data_scale(uint8_t *d_buff, uint8_t *s_buff, uint32_t
}
break;
case 16: {
DAC_AUDIO_CHECK(g_max_data_size > (len << 1), "write lengh exceed max_data_size you set", ESP_ERR_INVALID_ARG);
DAC_AUDIO_CHECK(g_max_data_size > (len << 1), "write length exceed max_data_size you set", ESP_ERR_INVALID_ARG);
len >>= 1;
uint16_t *b16 = (uint16_t *)s_buff;
for (int i = 0; i < len; i++) {
Expand All @@ -83,7 +83,7 @@ static esp_err_t _i2s_dac_data_scale(uint8_t *d_buff, uint8_t *s_buff, uint32_t
}
break;
case 32: {
DAC_AUDIO_CHECK(g_max_data_size > (len << 2), "write lengh exceed max_data_size you set", ESP_ERR_INVALID_ARG);
DAC_AUDIO_CHECK(g_max_data_size > (len << 2), "write length exceed max_data_size you set", ESP_ERR_INVALID_ARG);
len >>= 2;
uint32_t *b32 = (uint32_t *)s_buff;
for (int i = 0; i < len; i++) {
Expand Down
4 changes: 2 additions & 2 deletions components/audio/dac_audio/include/dac_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ typedef struct {
} dac_audio_config_t;

/**
* @brief initialize i2s build-in dac to play audio with
* @brief initialize i2s built-in dac to play audio with
*
* @attention only support ESP32, because i2s of ESP32S2 not have a build-in dac
* @attention only support ESP32, because i2s of ESP32S2 not have a built-in dac
*
* @param cfg configurations - see dac_audio_config_t struct
*
Expand Down
2 changes: 1 addition & 1 deletion components/audio/dac_audio/test/dac_audio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static void play_audio(const uint8_t *data, size_t wave_size, uint32_t rate, uin
uint32_t index = 0;
size_t cnt;
uint32_t block_w = 2048;
ESP_LOGI(TAG, "paramter: samplerate:%d, bits:%d, channel:%d", rate, bits, ch);
ESP_LOGI(TAG, "parameter: samplerate:%d, bits:%d, channel:%d", rate, bits, ch);
dac_audio_set_param(rate, bits, ch);
dac_audio_start();

Expand Down
2 changes: 1 addition & 1 deletion components/audio/pwm_audio/test/pwm_audio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void play_audio(const uint8_t *data, size_t wave_size, uint32_t rate, uin
uint32_t index = 0;
size_t cnt;
uint32_t block_w = 2048;
ESP_LOGI(TAG, "paramter: samplerate:%d, bits:%d, channel:%d", rate, bits, ch);
ESP_LOGI(TAG, "parameter: samplerate:%d, bits:%d, channel:%d", rate, bits, ch);
pwm_audio_set_param(rate, bits, ch);
pwm_audio_start();

Expand Down
2 changes: 1 addition & 1 deletion components/avi_player/avifile.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int strl_parser(avi_typedef *AVI_file, const uint8_t *buffer, uint32_t le
AVI_file->auds_bits = strf->bits_per_sample;
pdata += sizeof(AVI_AUDS_STRF_CHUNK);
} else {
ESP_LOGW(TAG, "Unsupport stream 0x%"PRIu32"", strh->fourcc_type);
ESP_LOGW(TAG, "Unsupported stream 0x%"PRIu32"", strh->fourcc_type);
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion components/avi_player/include/avi_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ esp_err_t avi_player_get_video_buffer(void **buffer, size_t *buffer_size, video_
* @brief Get the audio buffer from AVI file
*
* @param[out] buffer pointer to the audio buffer
* @param[inout] buffer_size size of the audio buffer
* @param[input] buffer_size size of the audio buffer
* @param[out] info audio frame information
* @param[in] ticks_to_wait maximum blocking time in ticks
*
Expand Down
2 changes: 1 addition & 1 deletion components/bluetooth/ble_conn_mgr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ Executing action: create-project-from-example
CMakeLists.txt not found in project directory /home/username
```

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.
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.
18 changes: 9 additions & 9 deletions components/bluetooth/ble_conn_mgr/src/esp_nimble.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -73,12 +73,12 @@ typedef struct svc_uuid_t {
SLIST_HEAD(svc_uuid_list_t, svc_uuid_t);

/**
* @brief This structure maps handler required by UUID which are used to read or writte.
* @brief This structure maps handler required by UUID which are used to read or write.
*/
typedef struct attr_mbuf_t {
SLIST_ENTRY(attr_mbuf_t) next;
uint8_t *outbuf; /* Data buffer as read or writte for characteristics */
uint16_t outlen; /* Data length as read or writte for characteristics */
uint8_t *outbuf; /* Data buffer as read or write for characteristics */
uint16_t outlen; /* Data length as read or write for characteristics */
uint16_t attr_handle; /* Executed handle when characteristic is read or written */
uint8_t type; /* Type of the UUID */
esp_ble_conn_uuid_t uuid; /* Universal UUID, to be used for any-UUID static allocation */
Expand All @@ -96,7 +96,7 @@ typedef struct {
} esp_ble_conn_event_ctx_t;

/**
* @brief This structure maps handler required by session which are used to BLE connnection management.
* @brief This structure maps handler required by session which are used to BLE connection management.
*/
typedef struct esp_ble_conn_session_t {
uint8_t *device_name; /* Name to be displayed to devices scanning */
Expand Down Expand Up @@ -1276,7 +1276,7 @@ static int esp_ble_conn_gap_event(struct ble_gap_event *event, void *arg)
break;
#if defined(CONFIG_BLE_CONN_MGR_PERIODIC_SYNC)
case BLE_GAP_EVENT_EXT_DISC:
/* An advertisment report was received during GAP discovery. */
/* An advertisement report was received during GAP discovery. */
ESP_LOGD(TAG, "BLE_GAP_EVENT_EXT_DISC");
struct ble_gap_ext_disc_desc *disc = ((struct ble_gap_ext_disc_desc *)(&event->disc));
if (disc->sid == 2 && !conn_session->ble_bonding) {
Expand Down Expand Up @@ -1660,7 +1660,7 @@ ble_gatt_add_primary_svcs(struct ble_gatt_svc_def *gatt_db_svcs, int char_count)
gatt_db_svcs->type = BLE_GATT_SVC_TYPE_PRIMARY;

/* Allocate (number of characteristics + 1) memory for characteristics, the
* addtional characteristic consist of all 0s indicating end of
* additional characteristic consist of all 0s indicating end of
* characteristics */
gatt_db_svcs->characteristics = (struct ble_gatt_chr_def *) calloc((char_count + 1), sizeof(struct ble_gatt_chr_def));
if (gatt_db_svcs->characteristics == NULL) {
Expand All @@ -1676,7 +1676,7 @@ esp_ble_conn_populate_gatt_db(esp_ble_conn_session_t *conn_session)
{
struct ble_gatt_svc_def *gatt_svr_svcs = NULL;

/* Allocate (number of services + 1) memory for services, the addtional services
/* Allocate (number of services + 1) memory for services, the additional services
* consist of all 0s indicating end of services */
gatt_svr_svcs = (struct ble_gatt_svc_def *) calloc(conn_session->nu_lookup_count + 1, sizeof(struct ble_gatt_svc_def));
if (gatt_svr_svcs == NULL) {
Expand Down Expand Up @@ -1736,7 +1736,7 @@ esp_ble_conn_populate_gatt_db(esp_ble_conn_session_t *conn_session)
/* GATT: Add user description to characteristic no. i*/
rc = ble_gatt_add_char_dsc((void *)gatt_svr_svcs[index].characteristics, svc_uuid->svc.nu_lookup, i, BLE_GATT_UUID_CHAR_DSC);
if (rc != 0) {
ESP_LOGE(TAG, "Error adding GATT Discriptor !!");
ESP_LOGE(TAG, "Error adding GATT Descriptor !!");
return rc;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ void esp_ble_ota_scheme_ble_event_cb_free_bt(void *user_data, esp_ble_ota_cb_eve
* the default UUID will be used.
*
* @note The data being pointed to by the argument must be valid
* atleast till ota is started. Upon start, the
* at least till ota is started. Upon start, the
* manager will store an internal copy of this UUID, and
* this data can be freed or invalidated afterwords.
* this data can be freed or invalidated afterwards.
*
* @param[in] uuid128 A custom 128 bit UUID
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Protobuf files for defining ota packet structures

`ble_ota` uses Google Protobuf for language, transport and architecture agnostic protocol communication. These proto files define the protocomm packet structure, separated across multiple fies:
* ota_send_file.proto - Defines OTA start, subsribe and send file commands and result structures.
* ota_send_file.proto - Defines OTA start, subscribe and send file commands and result structures.
Note : These proto files are not automatically compiled during the build process.

# Compilation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ void esp_ble_ota_process_recv_data(esp_ble_ota_char_t ota_char, uint8_t *val, ui
}

} else {
ESP_LOGE(TAG, "Unknow Command [0x%02x%02x]", val[1], val[0]);
ESP_LOGE(TAG, "Unknown Command [0x%02x%02x]", val[1], val[0]);
}
break;
case RECV_FW_CHAR:
Expand Down
2 changes: 1 addition & 1 deletion components/bluetooth/ble_profiles/std/ble_anp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Executing action: create-project-from-example
CMakeLists.txt not found in project directory /home/username
```

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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ESP_EVENT_DEFINE_BASE(BLE_ANP_EVENTS);
//4.09 Configure Alert Notification Control Point
static esp_err_t esp_ble_anp_alert_ctrl_set(uint8_t cmd_id, uint8_t cat_id)
{
/* ANS Control point command and catagory variables */
/* ANS Control point command and category variables */
uint8_t cat_bit_mask;

esp_ble_conn_data_t inbuff = {
Expand Down
2 changes: 1 addition & 1 deletion components/bluetooth/ble_profiles/std/ble_hrp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Executing action: create-project-from-example
CMakeLists.txt not found in project directory /home/username
```

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.
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.
2 changes: 1 addition & 1 deletion components/bluetooth/ble_profiles/std/ble_htp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Executing action: create-project-from-example
CMakeLists.txt not found in project directory /home/username
```

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.
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.
2 changes: 1 addition & 1 deletion components/bluetooth/ble_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Executing action: create-project-from-example
CMakeLists.txt not found in project directory /home/username
```

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.
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.
4 changes: 2 additions & 2 deletions components/bluetooth/ble_services/ans/src/esp_ans.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static esp_err_t ble_ans_new_alert_notify(uint8_t cat_id, const char *cat_info)
.data_len = cat_info_len + 2,
};

/* Clear notification to remove old infomation that may persist */
/* Clear notification to remove old information that may persist */
memset(&ble_ans_new_alert_val, 0, BLE_ANS_NEW_ALERT_MAX_LEN);

/* Set ID and count values */
Expand Down Expand Up @@ -169,7 +169,7 @@ static esp_err_t esp_ans_unr_alert_stat_cb(const uint8_t *inbuf, uint16_t inlen,
static esp_err_t esp_ans_alert_notify_ctrl_cb(const uint8_t *inbuf, uint16_t inlen,
uint8_t **outbuf, uint16_t *outlen, void *priv_data)
{
/* ANS Control point command and catagory variables */
/* ANS Control point command and category variables */
uint8_t cmd_id;
uint8_t cat_id;
uint8_t cat_bit_mask;
Expand Down
20 changes: 10 additions & 10 deletions components/bluetooth/ble_services/bas/include/esp_bas.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ typedef struct {
} power_state; /*!< Power State of Battery Level Status */

uint16_t identifier; /*!< Used as an identifier for a service instance. */
uint8_t battery_level; /*!< Refer to the Battery Leve */
uint8_t battery_level; /*!< Refer to the Battery Level */

struct {
uint8_t service_required: 2; /*!< Service Required */
Expand Down Expand Up @@ -247,22 +247,22 @@ typedef struct {
} __attribute__((packed)) esp_ble_bas_health_status_t;

/**
* @brief Battery Health Infomation Characteristic
* @brief Battery Health Information Characteristic
*/
typedef struct {
struct {
uint8_t en_cycle_count_designed_lifetime: 1; /*!< Cycle Count Designed Lifetime Present */
uint8_t min_max_designed_operating_temperature: 1; /*!< Min and Max Designed Operating Temperature Present */
uint8_t reserved: 5; /*!< Reserve Feature Used */
} flags; /*!< Flags of Battery Health Infomation */
} flags; /*!< Flags of Battery Health Information */

uint16_t cycle_count_designed_lifetime; /*!< Represents the designed number of charge cycles supported by the device */
int8_t min_designed_operating_temperature; /*!< Represents the minimum designed operating temperature of the battery */
int8_t max_designed_operating_temperature; /*!< Represents the maximum designed operating temperature of the battery */
} __attribute__((packed)) esp_ble_bas_health_info_t;

/**
* @brief Battery Infomation Characteristic
* @brief Battery Information Characteristic
*/
typedef struct {
struct {
Expand All @@ -275,13 +275,13 @@ typedef struct {
uint16_t en_nominalvoltage: 1; /*!< Nominal Voltage Present */
uint16_t en_aggregation_group: 1; /*!< Battery Aggregation Group Present */
uint16_t flags_reserved: 8; /*!< Reserve Feature Used */
} flags; /*!< Flags of Battery Infomation */
} flags; /*!< Flags of Battery Information */

struct {
uint8_t replace_able: 1; /*!< Battery Replaceable */
uint8_t recharge_able: 1; /*!< Battery Rechargeable */
uint8_t reserved: 7; /*!< Reserve Feature Used */
} features; /*!< Features of Battery Infomation */
} features; /*!< Features of Battery Information */

uint24_t manufacture_date; /*!< Battery date of manufacture specified as days */
uint24_t expiration_date; /*!< Battery expiration date specified as days */
Expand Down Expand Up @@ -469,7 +469,7 @@ esp_err_t esp_ble_bas_set_health_status(esp_ble_bas_health_status_t *status);
*
* @return
* - ESP_OK on successful
* - ESP_ERR_INVALID_ARG on wrong battery health infomation
* - ESP_ERR_INVALID_ARG on wrong battery health information
*/
esp_err_t esp_ble_bas_get_health_info(esp_ble_bas_health_info_t *info);

Expand All @@ -480,7 +480,7 @@ esp_err_t esp_ble_bas_get_health_info(esp_ble_bas_health_info_t *info);
*
* @return
* - ESP_OK on successful
* - ESP_ERR_INVALID_ARG on wrong battery health infomation
* - ESP_ERR_INVALID_ARG on wrong battery health information
*/
esp_err_t esp_ble_bas_set_health_info(esp_ble_bas_health_info_t *info);

Expand All @@ -491,7 +491,7 @@ esp_err_t esp_ble_bas_set_health_info(esp_ble_bas_health_info_t *info);
*
* @return
* - ESP_OK on successful
* - ESP_ERR_INVALID_ARG on wrong battery infomation
* - ESP_ERR_INVALID_ARG on wrong battery information
*/
esp_err_t esp_ble_bas_get_battery_info(esp_ble_bas_battery_info_t *info);

Expand All @@ -502,7 +502,7 @@ esp_err_t esp_ble_bas_get_battery_info(esp_ble_bas_battery_info_t *info);
*
* @return
* - ESP_OK on successful
* - ESP_ERR_INVALID_ARG on wrong battery infomation
* - ESP_ERR_INVALID_ARG on wrong battery information
*/
esp_err_t esp_ble_bas_set_battery_info(esp_ble_bas_battery_info_t *info);

Expand Down
Loading

0 comments on commit c0550db

Please sign in to comment.