Skip to content

Commit

Permalink
Add code-spell spelling checks to CI (#8067)
Browse files Browse the repository at this point in the history
Help find and fix silly spelling errors as they are added to the repo.
  • Loading branch information
earlephilhower committed May 23, 2021
1 parent 78a2ed6 commit 60fe7b4
Show file tree
Hide file tree
Showing 133 changed files with 273 additions and 260 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,18 @@ jobs:
bash ./tests/ci/build_boards.sh
bash ./tests/ci/eboot_test.sh
bash ./tests/ci/pkgrefs_test.sh
# Validate orthography
code-spell:
name: Check spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Run codespell
uses: codespell-project/actions-codespell@master
with:
skip: ./libraries/ESP8266SdFat,./libraries/LittleFS/lib,./tools/pyserial,./tools/sdk,./tools/esptool,./libraries/SoftwareSerial,./libraries/Ethernet,./github/workflows,./libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino,./libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino,./libraries/esp8266/examples/StreamString/StreamString.ino,./libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino,./libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino,./libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino,./libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino,./cores/esp8266/spiffs,./tests/device/test_libc/libm_string.c, ./libraries/Netdump/examples/Netdump/Netdump.ino,./libraries/ESP8266WiFi/examples/BearSSL_Server,./cores/esp8266/LwipIntfDev.h
ignore_words_list: ESP8266,esp8266,esp,dout,DOUT,ser,ans
3 changes: 1 addition & 2 deletions cores/esp8266/CallBackList.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#ifndef __CALLBACKLIST_H__
#define __CALLBACKLIST_H__


/*
CallBackList, An implemention for handling callback execution
CallBackList, An implementation for handling callback execution
Copyright (c) 2019 Herman Reintke. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/Esp-frag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
{
// L2 / Euclidian norm of free block sizes.
// L2 / Euclidean norm of free block sizes.
// Having getFreeHeap()=sum(hole-size), fragmentation is given by
// 100 * (1 - sqrt(sum(hole-size²)) / sum(hole-size))

Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "spi_vendors.h"

/**
* AVR macros for WDT managment
* AVR macros for WDT management
*/
typedef enum {
WDTO_0MS = 0, //!< WDTO_0MS
Expand Down Expand Up @@ -264,7 +264,7 @@ class EspClass {
static bool flashReplaceBlock(uint32_t address, const uint8_t *value, uint32_t byteCount);
/**
* @brief Write up to @a size bytes from @a data to flash at @a address
* This function takes case of unaligned memory acces by copying @a data to a temporary buffer,
* This function takes case of unaligned memory access by copying @a data to a temporary buffer,
* it also takes care of page boundary crossing see @a flashWritePageBreak as to why it's done.
* Less than @a size bytes may be written, due to 4 byte alignment requirement of spi_flash_write
* @param address address on flash where write should start
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/FSnoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void close_all_fs(void)
}

// default weak definitions
// they are overriden in their respective real implementation
// they are overridden in their respective real implementation
// hint: https://github.com/esp8266/Arduino/pull/6699#issuecomment-549085382

void littlefs_request_end(void) __attribute__((weak));
Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class HardwareSerial: public Stream

int peek(void) override
{
// return -1 when data is unvailable (arduino api)
// return -1 when data is unavailable (arduino api)
return uart_peek_char(_uart);
}

Expand Down Expand Up @@ -162,7 +162,7 @@ class HardwareSerial: public Stream

int read(void) override
{
// return -1 when data is unvailable (arduino api)
// return -1 when data is unavailable (arduino api)
return uart_read_char(_uart);
}
// ::read(buffer, size): same as readBytes without timeout
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/LwipDhcpServer-NonOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "C"
// trying to change legacy behavor
// `fw_has_started_softap_dhcps` will be read in DhcpServer::DhcpServer
// which is called when c++ ctors are initialized, specifically
// dhcpSoftAP intialized with AP interface number above.
// dhcpSoftAP initialized with AP interface number above.
fw_has_started_softap_dhcps = 1;
#endif
}
Expand Down
6 changes: 3 additions & 3 deletions cores/esp8266/LwipDhcpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ DhcpServer::DhcpServer(netif* netif): _netif(netif)
{ 0 } // gateway 0.0.0.0
};
begin(&ip);
fw_has_started_softap_dhcps = 2; // not 1, ending intial boot sequence
fw_has_started_softap_dhcps = 2; // not 1, ending initial boot sequence
}
};

Expand Down Expand Up @@ -454,10 +454,10 @@ uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
*optptr++ = 1;
*optptr++ = 0x00;

#if 0 // vendor specific unititialized (??)
#if 0 // vendor specific uninitialized (??)
*optptr++ = 43; // vendor specific
*optptr++ = 6;
// unitialized ?
// uninitialized ?
#endif

#if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Print {
inline size_t write(int8_t c) { return write((uint8_t) c); }

// default to zero, meaning "a single write may block"
// should be overriden by subclasses with buffering
// should be overridden by subclasses with buffering
virtual int availableForWrite() { return 0; }

size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3)));
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ long Stream::parseInt(char skipChar) {

do {
if(c == skipChar)
; // ignore this charactor
; // ignore this character
else if(c == '-')
isNegative = true;
else if(c >= '0' && c <= '9') // is c a digit?
Expand Down
12 changes: 6 additions & 6 deletions cores/esp8266/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,27 @@ class Stream: public Print {
// ::send*() methods:
// - always stop before timeout when "no-more-input-possible-data"
// or "no-more-output-possible-data" condition is met
// - always return number of transfered bytes
// - always return number of transferred bytes
// When result is 0 or less than requested maxLen, Print::getLastSend()
// contains an error reason.

// transfers already buffered / immediately available data (no timeout)
// returns number of transfered bytes
// returns number of transferred bytes
size_t sendAvailable (Print* to) { return sendGeneric(to, -1, -1, oneShotMs::alwaysExpired); }
size_t sendAvailable (Print& to) { return sendAvailable(&to); }

// transfers data until timeout
// returns number of transfered bytes
// returns number of transferred bytes
size_t sendAll (Print* to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, -1, timeoutMs); }
size_t sendAll (Print& to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendAll(&to, timeoutMs); }

// transfers data until a char is encountered (the char is swallowed but not transfered) with timeout
// returns number of transfered bytes
// transfers data until a char is encountered (the char is swallowed but not transferred) with timeout
// returns number of transferred bytes
size_t sendUntil (Print* to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, readUntilChar, timeoutMs); }
size_t sendUntil (Print& to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendUntil(&to, readUntilChar, timeoutMs); }

// transfers data until requested size or timeout
// returns number of transfered bytes
// returns number of transferred bytes
size_t sendSize (Print* to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, maxLen, -1, timeoutMs); }
size_t sendSize (Print& to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendSize(&to, maxLen, timeoutMs); }

Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/StreamString.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class StreamString: public String, public S2Stream
StreamString(StreamString&& bro): String(bro), S2Stream(this) { }
StreamString(const StreamString& bro): String(bro), S2Stream(this) { }

// duplicate String contructors and operator=:
// duplicate String constructors and operator=:

StreamString(const char* text = nullptr): String(text), S2Stream(this) { }
StreamString(const String& string): String(string), S2Stream(this) { }
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ size_t UpdaterClass::write(uint8_t *data, size_t len) {
left -= toBuff;
if(!_async) yield();
}
//lets see whats left
//lets see what's left
memcpy(_buffer + _bufferLen, data + (len - left), left);
_bufferLen += left;
if(_bufferLen == remaining()){
Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/Updater.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ class UpdaterClass {
bool setMD5(const char * expected_md5);

/*
returns the MD5 String of the sucessfully ended firmware
returns the MD5 String of the successfully ended firmware
*/
String md5String(void){ return _md5.toString(); }

/*
populated the result with the md5 bytes of the sucessfully ended firmware
populated the result with the md5 bytes of the successfully ended firmware
*/
void md5(uint8_t * result){ return _md5.getBytes(result); }

Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ void i2s_set_dividers(uint8_t div1, uint8_t div2) {
i2sc_temp |= (I2STXR); // Hold transmitter in reset
I2SC = i2sc_temp;

// trans master(active low), recv master(active_low), !bits mod(==16 bits/chanel), clear clock dividers
// trans master(active low), recv master(active_low), !bits mod(==16 bits/channel), clear clock dividers
i2sc_temp &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));

// I2SRF = Send/recv right channel first (? may be swapped form I2S spec of WS=0 => left)
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void init_done() {
know if other features are using this, or if this memory is going to be
used in future SDK releases.
WPS beeing flawed by its poor security, or not beeing used by lots of
WPS being flawed by its poor security, or not being used by lots of
users, it has been decided that we are still going to use that memory for
user's stack and disable the use of WPS.
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_noniso.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
core_esp8266_noniso.c - nonstandard (but usefull) conversion functions
core_esp8266_noniso.c - nonstandard (but useful) conversion functions
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_phy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
};


// These functions will be overriden from C++ code.
// These functions will be overridden from C++ code.
// Unfortunately, we can't use extern "C" because Arduino preprocessor
// doesn't generate forward declarations for extern "C" functions correctly,
// so we use mangled names here.
Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/core_esp8266_spi_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ _SPICommand(volatile uint32_t spiIfNum,
if (spiIfNum>1)
return SPI_RESULT_ERR;

// force SPI register access via base+offest.
// force SPI register access via base+offset.
// Prevents loading individual address constants from flash.
uint32_t *spibase = (uint32_t*)(spiIfNum ? &(SPI1CMD) : &(SPI0CMD));
#define SPIREG(reg) (*((volatile uint32_t *)(spibase+(&(reg) - &(SPI0CMD)))))
Expand Down Expand Up @@ -141,7 +141,7 @@ _SPICommand(volatile uint32_t spiIfNum,
* data has been sent.
*
* Note: This code has only been tested with SPI bus 0, but should work
* equally well with other busses. The ESP8266 has bus 0 and 1,
* equally well with other buses. The ESP8266 has bus 0 and 1,
* newer chips may have more one day.
*/
SpiOpResult SPI0Command(uint8_t cmd, uint32_t *data, uint32_t mosi_bits, uint32_t miso_bits) {
Expand Down
3 changes: 1 addition & 2 deletions cores/esp8266/core_esp8266_version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
core_esp8266_version.h - parse "git describe" at compile time
Copyright (c) 2018 david gauchard. All rights reserved.
Expand Down Expand Up @@ -159,7 +158,7 @@ int coreVersionSubRevision ()
}

/*
* unique revision indentifier (never decreases)
* unique revision identifier (never decreases)
*/
constexpr
int coreVersionNumeric ()
Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/core_esp8266_wiring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ void micros_overflow_tick(void* arg) {
//---------------------------------------------------------------------------
// millis() 'magic multiplier' approximation
//
// This function corrects the cumlative (296us / usec overflow) drift
// seen in the orignal 'millis()' function.
// This function corrects the cumulative (296us / usec overflow) drift
// seen in the original 'millis()' function.
//
// Input:
// 'm' - 32-bit usec counter, 0 <= m <= 0xFFFFFFFF
Expand Down
16 changes: 8 additions & 8 deletions cores/esp8266/esp8266_peri.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
#define TCIS 8 //Interrupt Status
#define TCTE 7 //Timer Enable
#define TCAR 6 //AutoReload (restart timer when condition is reached)
#define TCPD 2 //Prescale Devider (2bit) 0:1(12.5ns/tick), 1:16(0.2us/tick), 2/3:256(3.2us/tick)
#define TCPD 2 //Prescale Divider (2bit) 0:1(12.5ns/tick), 1:16(0.2us/tick), 2/3:256(3.2us/tick)
#define TCIT 0 //Interrupt Type 0:edge, 1:level

//RTC Registers
Expand Down Expand Up @@ -271,7 +271,7 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
#define UCRXI 19 //Invert RX
#define UCTXRST 18 //Reset TX FIFO
#define UCRXRST 17 //Reset RX FIFO
#define UCTXHFE 15 //TX Harware Flow Enable
#define UCTXHFE 15 //TX Hardware Flow Enable
#define UCLBE 14 //LoopBack Enable
#define UCBRK 8 //Send Break on the TX line
#define UCSWDTR 7 //Set this bit to assert DTR
Expand All @@ -283,11 +283,11 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];

//UART CONF1 Registers Bits
#define UCTOE 31 //RX TimeOut Enable
#define UCTOT 24 //RX TimeOut Treshold (7bit)
#define UCRXHFE 23 //RX Harware Flow Enable
#define UCRXHFT 16 //RX Harware Flow Treshold (7bit)
#define UCFET 8 //TX FIFO Empty Treshold (7bit)
#define UCFFT 0 //RX FIFO Full Treshold (7bit)
#define UCTOT 24 //RX TimeOut Threshold (7bit)
#define UCRXHFE 23 //RX Hardware Flow Enable
#define UCRXHFT 16 //RX Hardware Flow Threshold (7bit)
#define UCFET 8 //TX FIFO Empty Threshold (7bit)
#define UCFFT 0 //RX FIFO Full Threshold (7bit)

//WDT Feed (the dog) Register
#define WDTFEED ESP8266_REG(0x914)
Expand Down Expand Up @@ -372,7 +372,7 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
#define SPI1E3 ESP8266_REG(0x1FC)
#define SPI1W(p) ESP8266_REG(0x140 + ((p & 0xF) * 4))

//SPI0, SPI1 & I2S Interupt Register
//SPI0, SPI1 & I2S Interrupt Register
#define SPIIR ESP8266_DREG(0x20)
#define SPII0 4 //SPI0 Interrupt
#define SPII1 7 //SPI1 Interrupt
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/esp8266_undocumented.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ typedef void (*fn_c_exception_handler_t)(struct __exception_frame *ef, int cause
_xtos_c_handler_table[]. It is present when an exception handler has not been
registered. It simply consist of a single instruction, `ret`.
It is also internally used by `_xtos_set_exception_handler(cause, NULL)` to
reset a "C" exception handler back to the unhandled state. The coresponding
reset a "C" exception handler back to the unhandled state. The corresponding
`_xtos_exc_handler_table` entry will be set to `_xtos_unhandled_exception`.
Note, if nesting handlers is desired this must be implemented in the new "C"
exception handler(s) being registered.
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/exc-sethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* https://github.com/qca/open-ath9k-htc-firmware/blob/master/sboot/magpie_1_1/sboot/athos/src/xtos/exc-sethandler.c
*
* It has been revised to use Arduino ESP8266 core includes, types, and
* formating.
* formatting.
*/

/* exc-sethandler.c - register an exception handler in XTOS */
Expand Down
Loading

0 comments on commit 60fe7b4

Please sign in to comment.