Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spelling): Fix misspellings detected by codespell and enable it #10232

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[codespell]
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = ba,licence,ot,dout,als,exten,acount,totaly,pasttime
ignore-words-list = ba,licence,ot,dout,als,exten
skip = ./.git,./.licenses,__pycache__,.clang-format,.codespellrc,.editorconfig,.flake8,.prettierignore,.yamllint.yml,.gitignore,boards.txt,platform.txt,programmers.txt
builtin = clear,informal,en-GB_to_en-US
check-filenames =
check-hidden =
write-changes =
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
exclude: |
(?x)(
^\.github\/|
^tests\/performance\/coremark\/.*\.[ch]$
^tests\/performance\/coremark\/.*\.[ch]$|
^tests\/performance\/superpi\/.*\.(cpp|h)$|
LICENSE\.md$
)

default_language_version:
Expand All @@ -24,11 +26,10 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/codespell-project/codespell
rev: "v2.2.4"
rev: "v2.3.0"
hooks:
- id: codespell
exclude: ^.*\.(svd|SVD)$
stages: [manual]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.3"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void initArduino(void);
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);

uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder); // codespell:ignore shiftin
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions cores/esp32/HWCDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ size_t HWCDC::write(const uint8_t *buffer, size_t size) {
if (connected) {
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
}
// tracks CDC trasmission progress to avoid hanging if CDC is unplugged while still sending data
// tracks CDC transmission progress to avoid hanging if CDC is unplugged while still sending data
size_t last_toSend = to_send;
uint32_t tries = tx_timeout_ms; // waits 1ms per sending data attempt, in case CDC is unplugged
while (connected && to_send) {
Expand Down Expand Up @@ -479,7 +479,7 @@ size_t HWCDC::write(const uint8_t *buffer, size_t size) {
}
}
}
// CDC was diconnected while sending data ==> flush the TX buffer keeping the last data
// CDC was disconnected while sending data ==> flush the TX buffer keeping the last data
if (to_send && !usb_serial_jtag_ll_txfifo_writable()) {
connected = false;
flushTXBuffer(buffer + so_far, to_send);
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class HardwareSerial : public Stream {

// onReceive will setup a callback that will be called whenever an UART interruption occurs (UART_INTR_RXFIFO_FULL or UART_INTR_RXFIFO_TOUT)
// UART_INTR_RXFIFO_FULL interrupt triggers at UART_FULL_THRESH_DEFAULT bytes received (defined as 120 bytes by default in IDF)
// UART_INTR_RXFIFO_TOUT interrupt triggers at UART_TOUT_THRESH_DEFAULT symbols passed without any reception (defined as 10 symbos by default in IDF)
// UART_INTR_RXFIFO_TOUT interrupt triggers at UART_TOUT_THRESH_DEFAULT symbols passed without any reception (defined as 10 symbols by default in IDF)
// onlyOnTimeout parameter will define how onReceive will behave:
// Default: true -- The callback will only be called when RX Timeout happens.
// Whole stream of bytes will be ready for being read on the callback function at once.
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/esp32-hal-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct uart_struct_t {
bool has_peek; // flag to indicate that there is a peek byte pending to be read
uint8_t peek_byte; // peek byte that has been read but not consumed
QueueHandle_t uart_event_queue; // export it by some uartGetEventQueue() function
// configuration data:: Arduino API tipical data
// configuration data:: Arduino API typical data
int8_t _rxPin, _txPin, _ctsPin, _rtsPin; // UART GPIOs
uint32_t _baudrate, _config; // UART baudrate and config
// UART ESP32 specific data
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/wiring_shift.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "esp32-hal.h"
#include "wiring_private.h"

uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) {
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { // codespell:ignore shiftin
uint8_t value = 0;
uint8_t i;

Expand Down
2 changes: 1 addition & 1 deletion docs/en/api/gpio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ One of the most used and versatile peripheral in a microcontroller is the GPIO.

GPIO stands to General Purpose Input Output, and is responsible to control or read the state of a specific pin in the digital world. For example, this peripheral is widely used to create the LED blinking or to read a simple button.

.. note:: There are some GPIOs with special restrictions, and not all GPIOs are accessible through the developemnt board. For more information about it, see the corresponding board pin layout information.
.. note:: There are some GPIOs with special restrictions, and not all GPIOs are accessible through the development board. For more information about it, see the corresponding board pin layout information.

GPIOs Modes
***********
Expand Down
4 changes: 2 additions & 2 deletions docs/en/tutorials/preferences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ If you need to access a different namespace, close the one before opening the ot

currentNamespace.end(); // closes 'myNamespace'

currentNamespace.begin("myOtherNamespace", false); // opens a different Preferences namesspace.
currentNamespace.begin("myOtherNamespace", false); // opens a different Preferences namespace.
// do other stuff...

currentNamespace.end(); // closes 'myOtherNamespace'
Expand Down Expand Up @@ -644,7 +644,7 @@ Returning to the example above:

..

will assign to the variable ``dessert`` the String ``gravel`` if an error occurred, or the value stored against the key ``favourites`` if not.
will assign to the variable ``dessert`` the String ``gravel`` if an error occurred, or the value stored against the key ``favorites`` if not.

If we predetermine a default value that is outside all legitimate values, we now have a way to test if an error actually occurred.

Expand Down
2 changes: 1 addition & 1 deletion libraries/ArduinoOTA/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version=3.0.4
author=Ivan Grokhotkov and Hristo Gochkov
maintainer=Hristo Gochkov <[email protected]>
sentence=Enables Over The Air upgrades, via wifi and espota.py UDP request/TCP download.
paragraph=With this library you can enable your sketch to be upgraded over network. Includes mdns anounces to get discovered by the arduino IDE.
paragraph=With this library you can enable your sketch to be upgraded over network. Includes mdns announces to get discovered by the arduino IDE.
category=Communication
url=
architectures=esp32
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MyBLEExtAdvertisingCallbacks : public BLEExtAdvertisingCallbacks {
// here we can receive regular advertising data from BLE4.x devices
Serial.println("BLE4.2");
} else {
// here we will get extended advertising data that are advertised over data channel by BLE5 divices
// here we will get extended advertising data that are advertised over data channel by BLE5 devices
Serial.printf("Ext advertise: data_le: %d, data_status: %d \n", report.adv_data_len, report.data_status);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLERemoteCharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event,
}

// At this point, we have determined that the event is for us, so now we save the value
// and unlock the semaphore to ensure that the requestor of the data can continue.
// and unlock the semaphore to ensure that the requester of the data can continue.
if (evtParam->read.status == ESP_GATT_OK) {
m_value = String((char *)evtParam->read.value, evtParam->read.value_len);
if (m_rawData != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLERemoteDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void BLERemoteDescriptor::gattClientEventHandler(esp_gattc_cb_event_t event, esp
} else {
m_value = "";
}
// Unlock the semaphore to ensure that the requestor of the data can continue.
// Unlock the semaphore to ensure that the requester of the data can continue.
m_semaphoreReadDescrEvt.give();
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void setup() {
Serial.println("Didn't find any devices");
}
} else {
Serial.println("Error on discoverAsync f.e. not workin after a \"connect\"");
Serial.println("Error on discoverAsync f.e. not working after a \"connect\"");
}
}

Expand Down
6 changes: 3 additions & 3 deletions libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ static esp_err_t win_handler(httpd_req_t *req) {
int offsetX = parse_get_var(buf, "offx", 0);
int offsetY = parse_get_var(buf, "offy", 0);
int totalX = parse_get_var(buf, "tx", 0);
int totalY = parse_get_var(buf, "ty", 0);
int totalY = parse_get_var(buf, "ty", 0); // codespell:ignore totaly
int outputX = parse_get_var(buf, "ox", 0);
int outputY = parse_get_var(buf, "oy", 0);
bool scale = parse_get_var(buf, "scale", 0) == 1;
Expand All @@ -1110,10 +1110,10 @@ static esp_err_t win_handler(httpd_req_t *req) {

log_i(
"Set Window: Start: %d %d, End: %d %d, Offset: %d %d, Total: %d %d, Output: %d %d, Scale: %u, Binning: %u", startX, startY, endX, endY, offsetX, offsetY,
totalX, totalY, outputX, outputY, scale, binning
totalX, totalY, outputX, outputY, scale, binning // codespell:ignore totaly
);
sensor_t *s = esp_camera_sensor_get();
int res = s->set_res_raw(s, startX, startY, endX, endY, offsetX, offsetY, totalX, totalY, outputX, outputY, scale, binning);
int res = s->set_res_raw(s, startX, startY, endX, endY, offsetX, offsetY, totalX, totalY, outputX, outputY, scale, binning); // codespell:ignore totaly
if (res) {
return httpd_resp_send_500(req);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void setup() {
/*
If there are no external pull-up/downs, tie wakeup pins to inactive level with internal pull-up/downs via RTC IO
during deepsleep. However, RTC IO relies on the RTC_PERIPH power domain. Keeping this power domain on will
increase some power comsumption. However, if we turn off the RTC_PERIPH domain or if certain chips lack the RTC_PERIPH
increase some power consumption. However, if we turn off the RTC_PERIPH domain or if certain chips lack the RTC_PERIPH
domain, we will use the HOLD feature to maintain the pull-up and pull-down on the pins during sleep.
*/
rtc_gpio_pulldown_en(WAKEUP_GPIO); // GPIO33 is tie to GND in order to wake up in HIGH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
before reading data, if necessary.

In long UART transmissions, some data will be received based on FIFO Full parameter, and whenever
an error ocurs, it will raise the UART error interrupt.
an error occurs, it will raise the UART error interrupt.

This sketch produces BREAK UART error in the beginning of a transmission and also at the end of a
transmission. It will be possible to understand the order of the events in the logs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ void testAndReport(uint8_t fifoFull) {
}
}

uint32_t pastTime = millis() - now;
uint32_t pastTime = millis() - now; // codespell:ignore pasttime
Serial.printf("\nIt has sent %d bytes from Serial1 TX to Serial1 RX\n", sentBytes);
Serial.printf("It took %lu milliseconds to read %d bytes\n", pastTime, bytesReceived);
Serial.printf("It took %lu milliseconds to read %d bytes\n", pastTime, bytesReceived); // codespell:ignore pasttime
Serial.printf("Per execution Serial.read() number of bytes data and time information:\n");
for (i = 0; i < DATA_SIZE; i++) {
Serial.printf("#%03d - Received %03lu bytes after %lu ms.\n", i, bytesJustReceived[i], i > 0 ? timeStamp[i] - timeStamp[i - 1] : timeStamp[i] - now);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ void testAndReport(uint8_t rxTimeout) {
}
}

uint32_t pastTime = millis() - now;
uint32_t pastTime = millis() - now; // codespell:ignore pasttime
Serial.printf("\nIt has sent %d bytes from Serial1 TX to Serial1 RX\n", sentBytes);
Serial.printf("It took %lu milliseconds to read %d bytes\n", pastTime, bytesReceived);
Serial.printf("It took %lu milliseconds to read %d bytes\n", pastTime, bytesReceived); // codespell:ignore pasttime
Serial.print("Received data: [");
Serial.write(dataReceived, DATA_SIZE);
Serial.println("]");
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP32/examples/Touch/TouchButton/TouchButton.ino
lucasssvaz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*

This is an example how to use Touch Intrrerupts
The sketh will tell when it is touched and then relesased as like a push-button
The sketch will tell when it is touched and then released as like a push-button

This method based on touchInterruptSetThresholdDirection() is only available for ESP32
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*

This is an example how to use Touch Intrrerupts
The sketh will tell when it is touched and then relesased as like a push-button
The sketch will tell when it is touched and then released as like a push-button

This method based on touchInterruptGetLastStatus() is only available for ESP32 S2 and S3
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static void esp_zb_task(void *pvParameters) {
esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);

//Erase NVRAM before creating connection to new Coordinator
esp_zb_nvram_erase_at_start(true); //Comment out this line to erase NVRAM data if you are conneting to new Coordinator
esp_zb_nvram_erase_at_start(true); //Comment out this line to erase NVRAM data if you are connecting to new Coordinator

ESP_ERROR_CHECK(esp_zb_start(false));
esp_zb_main_loop_iteration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_NETWORK_FORMATION);
} else {
log_i("Device rebooted");
log_i("Openning network for joining for %d seconds", 180);
log_i("Opening network for joining for %d seconds", 180);
esp_zb_bdb_open_network(180);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static void esp_zb_task(void *pvParameters) {
esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);

//Erase NVRAM before creating connection to new Coordinator
//esp_zb_nvram_erase_at_start(true); //Comment out this line to erase NVRAM data if you are conneting to new Coordinator
//esp_zb_nvram_erase_at_start(true); //Comment out this line to erase NVRAM data if you are connecting to new Coordinator

ESP_ERROR_CHECK(esp_zb_start(false));
esp_zb_main_loop_iteration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_NETWORK_FORMATION);
} else {
log_i("Device rebooted");
log_i("Openning network for joining for %d seconds", 180);
log_i("Opening network for joining for %d seconds", 180);
esp_zb_bdb_open_network(180);
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions libraries/NetBIOS/src/NetBIOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct {
uint8_t flags1;
uint8_t flags2;
uint16_t qcount;
uint16_t acount;
uint16_t acount; // codespell:ignore acount
uint16_t nscount;
uint16_t adcount;
uint8_t name_len;
Expand All @@ -26,7 +26,7 @@ typedef struct {
uint8_t flags1;
uint8_t flags2;
uint16_t qcount;
uint16_t acount;
uint16_t acount; // codespell:ignore acount
uint16_t nscount;
uint16_t adcount;
uint8_t name_len;
Expand Down Expand Up @@ -84,7 +84,7 @@ void NetBIOS::_onPacket(AsyncUDPPacket &packet) {
nbnsa.flags1 = 0x85;
nbnsa.flags2 = 0;
append_16((void *)&nbnsa.qcount, 0);
append_16((void *)&nbnsa.acount, 1);
append_16((void *)&nbnsa.acount, 1); // codespell:ignore acount
append_16((void *)&nbnsa.nscount, 0);
append_16((void *)&nbnsa.adcount, 0);
nbnsa.name_len = question->name_len;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
https://en.wikipedia.org/wiki/Trust_on_first_use).

In this scheme; we start the very first time without any security checks
but once we have our first connection; we store the public crytpographic
but once we have our first connection; we store the public cryptographic
details (or a proxy, such as a sha256 of this). And then we use this for
any subsequent connections.

Expand Down
2 changes: 1 addition & 1 deletion libraries/OpenThread/examples/COAP/coap_lamp/coap_lamp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
}

void setupNode() {
// tries to set the Thread Network node and only returns when succeded
// tries to set the Thread Network node and only returns when succeeded
bool startedCorrectly = false;
while (!startedCorrectly) {
startedCorrectly |=
Expand Down
10 changes: 5 additions & 5 deletions libraries/OpenThread/examples/COAP/coap_switch/coap_switch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ bool otDeviceSetup(
}
Serial.println("OpenThread setup done. Node is ready.");
// all fine! LED goes and stays Blue
rgbLedWrite(RGB_BUILTIN, 0, 0, 64); // BLUE ... Swtich is ready!
rgbLedWrite(RGB_BUILTIN, 0, 0, 64); // BLUE ... Switch is ready!
return true;
}

void setupNode() {
// tries to set the Thread Network node and only returns when succeded
// tries to set the Thread Network node and only returns when succeeded
bool startedCorrectly = false;
while (!startedCorrectly) {
startedCorrectly |= otDeviceSetup(
Expand Down Expand Up @@ -138,19 +138,19 @@ bool otCoapPUT(bool lampState) {
return false;
}

// this fucntion is used by the Switch mode to check the BOOT Button and send the user action to the Lamp node
// this function is used by the Switch mode to check the BOOT Button and send the user action to the Lamp node
void checkUserButton() {
static long unsigned int lastPress = 0;
const long unsigned int debounceTime = 500;
static bool lastLampState = true; // first button press will turn the Lamp OFF from inital Green
static bool lastLampState = true; // first button press will turn the Lamp OFF from initial Green

pinMode(USER_BUTTON, INPUT_PULLUP); // C6/H2 User Button
if (millis() > lastPress + debounceTime && digitalRead(USER_BUTTON) == LOW) {
lastLampState = !lastLampState;
if (!otCoapPUT(lastLampState)) { // failed: Lamp Node is not responding due to be off or unreachable
// timeout from the CoAP PUT message... restart the node.
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... something failed!
Serial.println("Reseting the Node as Switch... wait.");
Serial.println("Resetting the Node as Switch... wait.");
// start over...
setupNode();
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/OpenThread/src/OThreadCLI_Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool otExecCommand(const char *cmd, const char *arg, ot_cmd_return_t *returnCode
i--; // search for ' ' before ":'
}
if (*i == ' ') {
i++; // move it forward to the number begining
i++; // move it forward to the number beginning
returnCode->errorCode = atoi(i);
returnCode->errorMessage = m;
} // otherwise, it will keep the "bad error message" information
Expand Down
Loading
Loading