Skip to content

ci: add codespell action #1554

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

Merged
merged 2 commits into from
Nov 23, 2021
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
27 changes: 27 additions & 0 deletions .github/workflows/CodeSpell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: codespell

on:
push:
branches:
- main
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

# See: https://github.com/codespell-project/actions-codespell/blob/master/README.md
- name: Spell check
uses: codespell-project/actions-codespell@master
with:
check_filenames: true
check_hidden: true
# In the event of a false positive, add the word in all lower case to this file:
ignore_words_file: ./CI/codespell/.codespellignore
skip: ./.git,./CI,./system/Drivers,./system/Middlewares
8 changes: 8 additions & 0 deletions CI/codespell/.codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
busses
dout
exten
hart
hsi
noe
nwe

5 changes: 5 additions & 0 deletions CI/codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
check-filenames =
check-hidden =
skip = ./.git,./CI,./system/Drivers,./system/Middlewares
ignore-words = ./CI/codespell/.codespellignore
21 changes: 21 additions & 0 deletions CI/codespell/codespell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [codespell]

[codespell] is used to check common misspellings and fix them.

To execute it within this repository, it has to be installed first, see [installation](https://github.com/codespell-project/codespell#installation).
Then run from the root folder this command using the configuration file:

* Linux or equivalent:

```console
codespell --config ./CI/codespell/.codespellrc
```

* Windows

```console
codespell.exe --config .\CI\codespell\.codespellrc
```


[codespell]: https://github.com/codespell-project/codespell
2 changes: 1 addition & 1 deletion CI/update/stm32cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
hal_dest_path = system_dest_path / hal_src_path
cmsis_dest_path = system_dest_path / hal_src_path / "CMSIS" / "Device" / "ST"

stm32_list = [] # Serie
stm32_list = [] # series
cube_versions = collections.OrderedDict() # key: serie name, value: cube version
cube_HAL_versions = collections.OrderedDict() # key: serie name, value: HAL version
cube_CMSIS_versions = collections.OrderedDict() # key: serie name, value: CMSIS version
Expand Down
2 changes: 1 addition & 1 deletion CI/update/stm32variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ def aggregate_dir():
# Get all mcu_dir
mcu_dirs = sorted(mcu_family.glob("*/"))

# Group mcu directories when only expressions and xml file name are differents
# Group mcu directories when only expressions and xml file name are different
while mcu_dirs:
# Pop first item
group_mcu_dir = [mcu_dirs.pop(0)]
Expand Down
2 changes: 1 addition & 1 deletion CI/utils/pathlib_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def copyFile(src, dest):


def genSTM32List(path, pattern):
stm32_list = [] # Serie
stm32_list = [] # series
dir_pattern = re.compile(r"^STM32(.*)xx_HAL_Driver$", re.IGNORECASE)

if pattern is not None:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To report a bug/request please file an issue in the right repository
(example for [Arduino_Core_STM32](https://github.com/stm32duino/Arduino_Core_STM32/issues/new/choose)).
But check the following boxes before posting an issue:

- [ ] `Make sure you are using the latest STM32 core and libraries versions.` See [lastest core here](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest).
- [ ] `Make sure you are using the latest STM32 core and libraries versions.` See [latest core here](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest).
- [ ] `Your issue is NOT a question/feedback/suggestions.` This should be discussed on the [stm32duino forum](http://stm32duino.com):
* questions on the [STM32 Core](http://stm32duino.com/viewforum.php?f=35).
* bugs/enhancements on the [STM core: Bugs and enhancements](http://stm32duino.com/viewforum.php?f=38).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![forums](https://img.shields.io/badge/join-the%20forums-blue.svg)](https://www.stm32duino.com/)
[![wiki](https://img.shields.io/badge/browse-the%20wiki-orange.svg)](https://github.com/stm32duino/wiki/wiki)
[![STM32 Core Continuous Integration](https://github.com/stm32duino/Arduino_Core_STM32/workflows/STM32%20Core%20Continuous%20Integration/badge.svg?branch=main)](https://github.com/stm32duino/Arduino_Core_STM32/actions)

[![codespell](https://github.com/stm32duino/Arduino_Core_STM32/workflows/codespell/badge.svg)](https://github.com/stm32duino/Arduino_Core_STM32/actions?workflow=codespell)


[![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Core_STM32.svg)](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ HardwareSerial::HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex)
setTx(PIN_SERIALLP2_TX);
} else
#endif
// else get the pins of the first peripheral occurence in PinMap
// else get the pins of the first peripheral occurrence in PinMap
{
_serial.pin_rx = pinmap_pin(peripheral, PinMap_UART_RX);
_serial.pin_tx = pinmap_pin(peripheral, PinMap_UART_TX);
Expand Down Expand Up @@ -485,7 +485,7 @@ void HardwareSerial::flush()
// nop, the interrupt handler will free up space for us
}
// If we get here, nothing is queued anymore (DRIE is disabled) and
// the hardware finished tranmission (TXC is set).
// the hardware finished transmission (TXC is set).
}

size_t HardwareSerial::write(const uint8_t *buffer, size_t size)
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// using a ring buffer (I think), in which head is the index of the location
// to which to write the next incoming character and tail is the index of the
// location from which to read.
// NOTE: a "power of 2" buffer size is reccomended to dramatically
// NOTE: a "power of 2" buffer size is recommended to dramatically
// optimize all the modulo operations for ring buffers.
// WARNING: When buffer sizes are increased to > 256, the buffer index
// variables are automatically increased in size, but the extra
Expand Down
32 changes: 16 additions & 16 deletions cores/arduino/HardwareTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ HardwareTimer::HardwareTimer()
* @brief HardwareTimer constructor: set default configuration values
* The timer will be usable directly, there is no need to call
* setup(). Using this constructor is not recommended for
* global variables that are automatically initalized at
* global variables that are automatically initialized at
* startup, since this will happen to early to report any
* errors. Better use the argumentless constructor and call the
* setup() method during initialization later.
Expand Down Expand Up @@ -195,7 +195,7 @@ void HardwareTimer::pauseChannel(uint32_t channel)
}
#endif

// In case 2 channels are used, disbale also the 2nd one
// In case 2 channels are used, disable also the 2nd one
if (_ChannelMode[channel - 1] == TIMER_INPUT_FREQ_DUTY_MEASUREMENT) {
// Identify and configure 2nd associated channel
timAssociatedInputChannel = getAssociatedChannel(channel);
Expand Down Expand Up @@ -470,7 +470,7 @@ void HardwareTimer::setPrescaleFactor(uint32_t prescaler)

/**
* @brief Retrieve overflow (rollover) value from hardware register
* @param format of returned value. If ommited default format is Tick
* @param format of returned value. If omitted default format is Tick
* @retval overflow depending on format value:
* TICK_FORMAT: return number of tick for overflow
* MICROSEC_FORMAT: return number of microsecondes for overflow
Expand Down Expand Up @@ -505,7 +505,7 @@ uint32_t HardwareTimer::getOverflow(TimerFormat_t format)
* (usually the next timer overflow). See setPreloadEnable()
* for controlling this behaviour.
* @param overflow: depend on format parameter
* @param format of overflow parameter. If ommited default format is Tick
* @param format of overflow parameter. If omitted default format is Tick
* TICK_FORMAT: overflow is the number of tick for overflow
* MICROSEC_FORMAT: overflow is the number of microsecondes for overflow
* HERTZ_FORMAT: overflow is the frequency in hertz for overflow
Expand Down Expand Up @@ -548,8 +548,8 @@ void HardwareTimer::setOverflow(uint32_t overflow, TimerFormat_t format)
}

/**
* @brief Retreive timer counter value
* @param format of returned value. If ommited default format is Tick
* @brief Retrieve timer counter value
* @param format of returned value. If omitted default format is Tick
* @retval overflow depending on format value:
* TICK_FORMAT: return number of tick for counter
* MICROSEC_FORMAT: return number of microsecondes for counter
Expand Down Expand Up @@ -578,7 +578,7 @@ uint32_t HardwareTimer::getCount(TimerFormat_t format)
/**
* @brief Set timer counter value
* @param counter: depend on format parameter
* @param format of overflow parameter. If ommited default format is Tick
* @param format of overflow parameter. If omitted default format is Tick
* TICK_FORMAT: counter is the number of tick
* MICROSEC_FORMAT: counter is the number of microsecondes
* HERTZ_FORMAT: counter is the frequency in hertz
Expand Down Expand Up @@ -793,7 +793,7 @@ void HardwareTimer::setPreloadEnable(bool value)
* @brief Set channel Capture/Compare register
* @param channel: Arduino channel [1..4]
* @param compare: compare value depending on format
* @param format of compare parameter. If ommited default format is Tick
* @param format of compare parameter. If omitted default format is Tick
* TICK_FORMAT: compare is the number of tick
* MICROSEC_FORMAT: compare is the number of microsecondes
* HERTZ_FORMAT: compare is the frequency in hertz
Expand Down Expand Up @@ -857,7 +857,7 @@ void HardwareTimer::setCaptureCompare(uint32_t channel, uint32_t compare, TimerC
/**
* @brief Retrieve Capture/Compare value
* @param channel: Arduino channel [1..4]
* @param format of return value. If ommited default format is Tick
* @param format of return value. If omitted default format is Tick
* TICK_FORMAT: return value is the number of tick for Capture/Compare value
* MICROSEC_FORMAT: return value is the number of microsecondes for Capture/Compare value
* HERTZ_FORMAT: return value is the frequency in hertz for Capture/Compare value
Expand Down Expand Up @@ -913,7 +913,7 @@ uint32_t HardwareTimer::getCaptureCompare(uint32_t channel, TimerCompareFormat_
/**
* @param channel: Arduino channel [1..4]
* @param pin: Arduino pin number, ex D1, 1 or PA1
* @param frequency: PWM frequency expessed in hertz
* @param frequency: PWM frequency expressed in hertz
* @param dutycycle: PWM dutycycle expressed in percentage
* @param PeriodCallback: timer period callback (timer rollover upon udate event)
* @param CompareCallback: timer compare callback
Expand All @@ -928,7 +928,7 @@ void HardwareTimer::setPWM(uint32_t channel, uint32_t pin, uint32_t frequency, u
* @brief All in one function to configure PWM
* @param channel: Arduino channel [1..4]
* @param pin: pin name, ex PB_0
* @param frequency: PWM frequency expessed in hertz
* @param frequency: PWM frequency expressed in hertz
* @param dutycycle: PWM dutycycle expressed in percentage
* @param PeriodCallback: timer period callback (timer rollover upon udate event)
* @param CompareCallback: timer compare callback
Expand Down Expand Up @@ -992,7 +992,7 @@ void HardwareTimer::attachInterrupt(callback_function_t callback)
}

/**
* @brief Dettach interrupt callback on update (rollover) event
* @brief Detach interrupt callback on update (rollover) event
* @retval None
*/
void HardwareTimer::detachInterrupt()
Expand Down Expand Up @@ -1033,7 +1033,7 @@ void HardwareTimer::attachInterrupt(uint32_t channel, callback_function_t callba
}

/**
* @brief Dettach interrupt callback on Capture/Compare event
* @brief Detach interrupt callback on Capture/Compare event
* @param channel: Arduino channel [1..4]
* @retval None
*/
Expand Down Expand Up @@ -1078,7 +1078,7 @@ bool HardwareTimer::hasInterrupt(uint32_t channel)
/**
* @brief Generate an update event to force all registers (Autoreload, prescaler, compare) to be taken into account
* @note Refresh() can only be called after a 1st call to resume() to be sure timer is initialised.
* It is usefull while timer is running after some registers update
* It is useful while timer is running after some registers update
* @retval None
*/
void HardwareTimer::refresh()
Expand Down Expand Up @@ -1118,7 +1118,7 @@ void HardwareTimer::updateCallback(TIM_HandleTypeDef *htim)
}

/**
* @brief Generic Caputre and Compare callback which will call user callback
* @brief Generic Capture and Compare callback which will call user callback
* @param htim: HAL timer handle
* @retval None
*/
Expand Down Expand Up @@ -1187,7 +1187,7 @@ bool HardwareTimer::isRunningChannel(uint32_t channel)
Error_Handler();
}

// channel is runnning if: timer is running, and either output channel is
// channel is running if: timer is running, and either output channel is
// enabled or interrupt is set
ret = LL_TIM_CC_IsEnabledChannel(_timerObj.handle.Instance, LLChannel)
|| (__HAL_TIM_GET_IT_SOURCE(&(_timerObj.handle), interrupt) == SET);
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/HardwareTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class HardwareTimer {
void setOverflow(uint32_t val, TimerFormat_t format = TICK_FORMAT); // set AutoReload register depending on format provided
uint32_t getOverflow(TimerFormat_t format = TICK_FORMAT); // return overflow depending on format provided

void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrup.
void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrupt.
void setPWM(uint32_t channel, uint32_t pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr);

void setCount(uint32_t val, TimerFormat_t format = TICK_FORMAT); // set timer counter to value 'val' depending on format provided
Expand Down Expand Up @@ -143,7 +143,7 @@ class HardwareTimer {
bool hasInterrupt(uint32_t channel); //returns true if an interrupt has already been set on the channel compare match
void timerHandleDeinit(); // Timer deinitialization

// Refresh() is usefull while timer is running after some registers update
// Refresh() is useful while timer is running after some registers update
void refresh(void); // Generate update event to force all registers (Autoreload, prescaler, compare) to be taken into account

uint32_t getTimerClkFreq(); // return timer clock frequency in Hz.
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Print {
}

// 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;
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <inttypes.h>
#include "Print.h"

// compatability macros for testing
// compatibility macros for testing
/*
#define getInt() parseInt()
#define getInt(ignore) parseInt(ignore)
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class String {

// returns true on success, false on failure (in which case, the string
// is left unchanged). if the argument is null or invalid, the
// concatenation is considered unsucessful.
// concatenation is considered unsuccessful.
unsigned char concat(const String &str);
unsigned char concat(const char *cstr);
unsigned char concat(char c);
Expand Down Expand Up @@ -213,7 +213,7 @@ class String {
unsigned char startsWith(const String &prefix, unsigned int offset) const;
unsigned char endsWith(const String &suffix) const;

// character acccess
// character access
char charAt(unsigned int index) const;
void setCharAt(unsigned int index, char c);
char operator [](unsigned int index) const;
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ PinName analogInputToPinName(uint32_t pin);
#define digitalPinIsValid(p) (digitalPinToPinName(p) != NC)

/* As some pin could be duplicated in digitalPin[] */
/* return first occurence of linked PinName (PYx) */
/* return first occurrence of linked PinName (PYx) */
#define digitalPinFirstOccurence(p) (pinNametoDigitalPin(digitalPinToPinName(p)))

/* Specific for Firmata */
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/stm32/OpenAMP/rsc_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
******************************************************************************
* @file rsc_table.c
* @author MCD Application Team
* @brief Ressource table
* @brief Resource table
*
* This file provides a default resource table requested by remote proc to
* load the elf file. It also allows to add debug trace using a shared buffer.
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/stm32/OpenAMP/virtio_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static uint16_t read(virtio_buffer_t *ring, uint8_t *dst, uint16_t size, bool pe
// Manage ring buffer rollover
// First, copy ring buffer from read index to end of buffer
memcpy(dst, ring->buffer + read_index, VIRTIO_BUFFER_SIZE - read_index);
// then, copy ring buffer from begining of buffer to end of read
// then, copy ring buffer from beginning of buffer to end of read
memcpy(dst + VIRTIO_BUFFER_SIZE - read_index, ring->buffer, size - (VIRTIO_BUFFER_SIZE - read_index));
} else {
memcpy(dst, ring->buffer + read_index, size);
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/stm32/PeripheralPins.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern const PinMap PinMap_I2C_SDA[];
extern const PinMap PinMap_I2C_SCL[];

//*** TIM ***
/* For backward compatibilty */
/* For backward compatibility */
#define PinMap_PWM PinMap_TIM
extern const PinMap PinMap_TIM[];

Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/stm32/usb/cdc/usbd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ __ALIGN_BEGIN static uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN
};

__ALIGN_BEGIN static uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END = {
0x09, /* bLength: Configuation Descriptor size */
0x09, /* bLength: Configuration Descriptor size */
USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION,
USB_CDC_CONFIG_DESC_SIZ,
0x00,
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/stm32/usb/hid/usbd_hid_composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef *pdev,
static uint8_t USBD_COMPOSITE_HID_Setup(USBD_HandleTypeDef *pdev,
USBD_SetupReqTypedef *req)
{
/* Check which interface is targetted by this request */
/* Check which interface is targeted by this request */
if ((req->wIndex & 0x00FF) == HID_KEYBOARD_INTERFACE) {
return USBD_HID_KEYBOARD_Setup(pdev, req);
} else {
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/stm32/usb/hid/usbd_hid_composite_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void HID_Composite_DeInit(HID_Interface device)
/**
* @brief Send HID mouse Report
* @param report pointer to report
* @param len report lenght
* @param len report length
* @retval none
*/
void HID_Composite_mouse_sendReport(uint8_t *report, uint16_t len)
Expand All @@ -98,7 +98,7 @@ void HID_Composite_mouse_sendReport(uint8_t *report, uint16_t len)
/**
* @brief Send HID keyboard Report
* @param report pointer to report
* @param len report lenght
* @param len report length
* @retval none
*/
void HID_Composite_keyboard_sendReport(uint8_t *report, uint16_t len)
Expand Down
Loading