Skip to content

Commit 173e8ea

Browse files
authored
Merge pull request #150 from per1234/spell-check
Add CI workflow to check for commonly misspelled words
2 parents d06d9b2 + 14defce commit 173e8ea

19 files changed

+51
-21
lines changed

Diff for: .codespellrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = hel
5+
check-filenames =
6+
check-hidden =
7+
skip = ./.git,./test/external

Diff for: .github/workflows/spell-check.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Spell Check
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
spellcheck:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Spell check
22+
uses: codespell-project/actions-codespell@master

Diff for: .github/workflows/unit-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Unit Tests
22

33
on:
44
pull_request:
5-
# Only run workflow if a file in these paths are modified
5+
# Only run workflow if a file in these paths is modified
66
paths:
77
- ".github/workflows/unit-tests.yml"
88
- "test/**"

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
[![Unit Tests](https://github.com/arduino/ArduinoCore-API/workflows/Unit%20Tests/badge.svg)](https://github.com/arduino/ArduinoCore-API/actions?workflow=Unit+Tests)
44
[![codecov](https://codecov.io/gh/arduino/ArduinoCore-API/branch/master/graph/badge.svg)](https://codecov.io/gh/arduino/ArduinoCore-API)
5+
[![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)
56

67
This repository hosts the hardware independent layer of Arduino core.
78

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

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

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

2122
### Porting tips
2223

23-
In the future, core apis will be updated independently from the core, so all the compatible cores will seamlessly adopt new features.
24+
In the future, core APIs will be updated independently from the core, so all the compatible cores will seamlessly adopt new features.
2425
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.
2526

2627
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.

Diff for: api/IPAddress.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool IPAddress::fromString(const char *address)
6666
else if (c == '.')
6767
{
6868
if (dots == 3) {
69-
// Too much dots (there must be 3 dots)
69+
// Too many dots (there must be 3 dots)
7070
return false;
7171
}
7272
if (acc < 0) {

Diff for: api/Udp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ class UDP : public Stream {
4848

4949
// Sending UDP packets
5050

51-
// Start building up a packet to send to the remote host specific in ip and port
51+
// Start building up a packet to send to the remote host specified in ip and port
5252
// Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
5353
virtual int beginPacket(IPAddress ip, uint16_t port) =0;
54-
// Start building up a packet to send to the remote host specific in host and port
54+
// Start building up a packet to send to the remote host specified in host and port
5555
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port
5656
virtual int beginPacket(const char *host, uint16_t port) =0;
5757
// Finish off this packet and send it

Diff for: api/deprecated-avr-comp/avr/interrupt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
/*
2020
Empty file.
2121
This file is here to allow compatibility with sketches (made for AVR)
22-
that includes <AVR/interrupt.h>
22+
that include <AVR/interrupt.h>
2323
*/

Diff for: api/deprecated/Client.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/HardwareSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/IPAddress.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/Print.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/Printable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/Server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/Stream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/Udp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: api/deprecated/WString.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

Diff for: test/src/Stream/test_readBytes.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TEST_CASE ("Testing readBytes(char *buffer, size_t length)", "[Stream-readBytes-
2525
REQUIRE(mock.readBytes(buf, sizeof(buf)) == 0);
2626
}
2727

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

39-
WHEN ("the stream contains more data then we want to read")
39+
WHEN ("the stream contains more data than we want to read")
4040
{
4141
char buf[5] = {0};
4242
mock << "some stream content";

Diff for: test/src/String/test_replace.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ TEST_CASE ("Testing String::replace(char, char) when string contains elements =
3939
REQUIRE(str == "H3ll0 Ardu1n0!");
4040
}
4141

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

49-
TEST_CASE ("Testing String::replace(String, String) when string constains subtr 'find'", "[String-replace-05]")
49+
TEST_CASE ("Testing String::replace(String, String) when string contains substr 'find'", "[String-replace-05]")
5050
{
5151
arduino::String str("Hello Arduino!");
5252
str.replace(arduino::String("ll"), arduino::String("11"));

Diff for: test/src/String/test_trim.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TEST_CASE ("Testing String::trim with space at the end", "[String-trim-02]")
3030
REQUIRE(str == "hello");
3131
}
3232

33-
TEST_CASE ("Testing String::trim with space at both beginng and end", "[String-trim-03]")
33+
TEST_CASE ("Testing String::trim with space at both beginning and end", "[String-trim-03]")
3434
{
3535
arduino::String str(" hello ");
3636
str.trim();

0 commit comments

Comments
 (0)