Skip to content

Add CI workflow to check for commonly misspelled words #150

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
May 31, 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
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = hel
check-filenames =
check-hidden =
skip = ./.git,./test/external
22 changes: 22 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Spell Check

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
spellcheck:
runs-on: ubuntu-latest

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

- name: Spell check
uses: codespell-project/actions-codespell@master
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Unit Tests

on:
pull_request:
# Only run workflow if a file in these paths are modified
# Only run workflow if a file in these paths is modified
paths:
- ".github/workflows/unit-tests.yml"
- "test/**"
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

[![Unit Tests](https://github.com/arduino/ArduinoCore-API/workflows/Unit%20Tests/badge.svg)](https://github.com/arduino/ArduinoCore-API/actions?workflow=Unit+Tests)
[![codecov](https://codecov.io/gh/arduino/ArduinoCore-API/branch/master/graph/badge.svg)](https://codecov.io/gh/arduino/ArduinoCore-API)
[![Spell Check status](https://github.com/arduino/ArduinoCore-API/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino/ArduinoCore-API/actions/workflows/spell-check.yml)

This repository hosts the hardware independent layer of Arduino core.

All Arduino official cores are being ported to the new structure so they take advantage of this single repo.

Including this repo in your existing Arduino core will allow the language to grow and include new features.
For backwards compatibility, every revision of this repo will increase `ARDUINO_API_VERSION` define.
For backwards compatibility, every revision of this repo will increase the `ARDUINO_API_VERSION` define.

Some cores have been ported to the new structure, for example:
* megaAVR (https://github.com/arduino/ArduinoCore-megaAVR)
Expand All @@ -20,7 +21,7 @@ These repositories **don't** contain the needed `api` subfolder; to "complete" t

### Porting tips

In the future, core apis will be updated independently from the core, so all the compatible cores will seamlessly adopt new features.
In the future, core APIs will be updated independently from the core, so all the compatible cores will seamlessly adopt new features.
This requires support from all the IDEs, so in the meantime we suggest to release the core by copying a snapshot of this `api` folder.

The most elegant and effective solution is to develop the core with `api` symlinked and produce the distributable archive by telling `tar` to follow symlinks.
Expand Down
2 changes: 1 addition & 1 deletion api/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ bool IPAddress::fromString(const char *address)
else if (c == '.')
{
if (dots == 3) {
// Too much dots (there must be 3 dots)
// Too many dots (there must be 3 dots)
return false;
}
if (acc < 0) {
Expand Down
4 changes: 2 additions & 2 deletions api/Udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class UDP : public Stream {

// Sending UDP packets

// Start building up a packet to send to the remote host specific in ip and port
// Start building up a packet to send to the remote host specified in ip and port
// Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
virtual int beginPacket(IPAddress ip, uint16_t port) =0;
// Start building up a packet to send to the remote host specific in host and port
// Start building up a packet to send to the remote host specified in host and port
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port
virtual int beginPacket(const char *host, uint16_t port) =0;
// Finish off this packet and send it
Expand Down
2 changes: 1 addition & 1 deletion api/deprecated-avr-comp/avr/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
/*
Empty file.
This file is here to allow compatibility with sketches (made for AVR)
that includes <AVR/interrupt.h>
that include <AVR/interrupt.h>
*/
2 changes: 1 addition & 1 deletion api/deprecated/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including Client.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../Client.h"

Expand Down
2 changes: 1 addition & 1 deletion api/deprecated/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including HardwareSerial.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../HardwareSerial.h"

Expand Down
2 changes: 1 addition & 1 deletion api/deprecated/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including IPAddress.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../IPAddress.h"

Expand Down
2 changes: 1 addition & 1 deletion api/deprecated/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including Print.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../Print.h"

2 changes: 1 addition & 1 deletion api/deprecated/Printable.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including Printable.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../Printable.h"

2 changes: 1 addition & 1 deletion api/deprecated/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including Server.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../Server.h"

Expand Down
2 changes: 1 addition & 1 deletion api/deprecated/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including Stream.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../Stream.h"

Expand Down
2 changes: 1 addition & 1 deletion api/deprecated/Udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including Udp.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../Udp.h"

Expand Down
2 changes: 1 addition & 1 deletion api/deprecated/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// including WString.h is deprecated, for all future projects use Arduino.h instead

// This include is added for compatibility, it will be remove on the next
// This include is added for compatibility, it will be removed on the next
// major release of the API
#include "../String.h"

4 changes: 2 additions & 2 deletions test/src/Stream/test_readBytes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TEST_CASE ("Testing readBytes(char *buffer, size_t length)", "[Stream-readBytes-
REQUIRE(mock.readBytes(buf, sizeof(buf)) == 0);
}

WHEN ("the stream contains less data then we want to read")
WHEN ("the stream contains less data than we want to read")
{
char buf[32] = {0};
char const str[] = "some stream content";
Expand All @@ -36,7 +36,7 @@ TEST_CASE ("Testing readBytes(char *buffer, size_t length)", "[Stream-readBytes-
REQUIRE(mock.readString() == arduino::String(""));
}

WHEN ("the stream contains more data then we want to read")
WHEN ("the stream contains more data than we want to read")
{
char buf[5] = {0};
mock << "some stream content";
Expand Down
4 changes: 2 additions & 2 deletions test/src/String/test_replace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ TEST_CASE ("Testing String::replace(char, char) when string contains elements =
REQUIRE(str == "H3ll0 Ardu1n0!");
}

TEST_CASE ("Testing String::replace(String, String) when string does not constain subtr 'find'", "[String-replace-04]")
TEST_CASE ("Testing String::replace(String, String) when string does not contain substr 'find'", "[String-replace-04]")
{
arduino::String str("Hello Arduino!");
str.replace(arduino::String("Zulu"), arduino::String("11"));
REQUIRE(str == "Hello Arduino!");
}

TEST_CASE ("Testing String::replace(String, String) when string constains subtr 'find'", "[String-replace-05]")
TEST_CASE ("Testing String::replace(String, String) when string contains substr 'find'", "[String-replace-05]")
{
arduino::String str("Hello Arduino!");
str.replace(arduino::String("ll"), arduino::String("11"));
Expand Down
2 changes: 1 addition & 1 deletion test/src/String/test_trim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_CASE ("Testing String::trim with space at the end", "[String-trim-02]")
REQUIRE(str == "hello");
}

TEST_CASE ("Testing String::trim with space at both beginng and end", "[String-trim-03]")
TEST_CASE ("Testing String::trim with space at both beginning and end", "[String-trim-03]")
{
arduino::String str(" hello ");
str.trim();
Expand Down