Skip to content

Commit cef0f02

Browse files
Added spelling CI (#316)
* Updating comments and documents * Function rename for spelling fix * Updating the CI config * Updated changelog * Revert copied arduino files * Moving all setting to codespell config * Move setting from CI to config for codespell
1 parent d72c378 commit cef0f02

25 files changed

+81
-48
lines changed

.codespellignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
aci
2+
ba
3+
flem

.codespellrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
skip = ./cpp/arduino/avr/*
3+
ignore-words=.codespellignore

.github/workflows/spelling.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This is the name of the workflow, visible on GitHub UI
2+
name: Check Spelling
3+
4+
on:
5+
push:
6+
branches-ignore: [master, main]
7+
# Remove the line above to run when pushing to master
8+
pull_request:
9+
branches: [master, main]
10+
11+
jobs:
12+
build:
13+
name: Check Spelling
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v2
19+
with:
20+
# Full git history is needed to get a proper list of changed files within `super-linter`
21+
fetch-depth: 0
22+
23+
- name: Check Spelling
24+
uses: codespell-project/actions-codespell@master
25+
with:
26+
check_filenames: true

CHANGELOG.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99
### Added
1010
- Allow use of watchdog timer in application code (though it doesn't do anything)
1111
- Show output from successful compile
12-
- `--min-free-space=N` command-line argument to fail if free space is below requred value
12+
- `--min-free-space=N` command-line argument to fail if free space is below required value
1313
- Add `_BV()` macro.
1414
- Support for `dtostrf()`
15+
- Added a CI workflow to check for spelling errors
1516

1617
### Changed
1718
- We now compile a shared library to be used for each test.
@@ -39,7 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3940
- Better indications of which example sketch is being compiled as part of testing
4041

4142
### Changed
42-
- Topmost installtion instructions now suggest `gem install arduino_ci` instead of using a `Gemfile`. Reasons for using a `Gemfile` are listed and discussed separately further down the README.
43+
- Topmost installation instructions now suggest `gem install arduino_ci` instead of using a `Gemfile`. Reasons for using a `Gemfile` are listed and discussed separately further down the README.
4344
- Stream::readStreamUntil() no longer returns delimiter
4445

4546
### Removed
@@ -100,7 +101,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
100101
## [1.0.0] - 2020-11-29
101102
### Added
102103
- Special handling of attempts to run the `arduino_ci.rb` CI script against the ruby library instead of an actual Arduino project
103-
- Explicit checks for attemping to test `arduino_ci` itself as if it were a library, resolving a minor annoyance to this developer.
104+
- Explicit checks for attempting to test `arduino_ci` itself as if it were a library, resolving a minor annoyance to this developer.
104105
- Code coverage tooling
105106
- Explicit check and warning for library directory names that do not match our guess of what the library should/would be called
106107
- Symlink tests for `Host`
@@ -207,7 +208,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
207208
## [0.1.21] - 2019-02-07
208209
### Added
209210
- Proper `ostream operator <<` for `nullptr`
210-
- Proper comparison operations fro `nullptr`
211+
- Proper comparison operations for `nullptr`
211212

212213
### Changed
213214
- `Compare.h` heavily refactored to use a smallish macro
@@ -235,7 +236,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
235236

236237
### Fixed
237238
- Assertions on `nullptr`
238-
- The defintion of `nullptr`
239+
- The definition of `nullptr`
239240

240241

241242
## [0.1.18] - 2019-01-29
@@ -298,7 +299,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
298299
- Checking for (empty) set of platforms to build now precedes the check for examples to build; this avoids assuming that all libraries will have an example and dumping the file set when none are found
299300

300301
### Fixed
301-
- Spaces in the names of project directores no longer cause unit test binaries to fail execution
302+
- Spaces in the names of project directories no longer cause unit test binaries to fail execution
302303
- Configuration file overrides with `nil`s (or empty arrays) now properly override their base configuration
303304

304305

@@ -429,15 +430,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
429430
### Fixed
430431
- Replaced pipes with `Open3.capture3` to avoid deadlocks when commands have too much output
431432
- `ci_config.rb` now returns empty arrays (instead of nil) for undefined config keys
432-
- `pgmspace.h` explictly includes `<string.h>`
433+
- `pgmspace.h` explicitly includes `<string.h>`
433434
- `__FlashStringHelper` should now be properly mocked for compilation
434435
- `WString.h` bool operator now works and is simpler
435436

436437

437438
## [0.1.5] - 2018-03-05
438439
### Added
439440
- Yaml files can have either `.yml` or `.yaml` extensions
440-
- Yaml files support select/reject critera for paths of unit tests for targeted testing
441+
- Yaml files support select/reject criteria for paths of unit tests for targeted testing
441442
- Pins now track history and can report it in Ascii (big- or little-endian) for digital sequences
442443
- Pins now accept an array (or string) of input bits for providing pin values across multiple reads
443444
- FlashStringHelper (and related macros) compilation mocks
@@ -490,7 +491,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
490491
### Fixed
491492
- All test files were reporting "not ok" in TAP output. Now they are OK iff all asserts pass.
492493
- Directories with a C++ extension in their name could cause problems. Now they are ignored.
493-
- `CppLibrary` had trouble with symlinks. It shoudn't anymore.
494+
- `CppLibrary` had trouble with symlinks. It shouldn't anymore.
494495
- `CppLibrary` had trouble with vendor bundles. It might in the future, but I have a better fix ready to go if it's an issue.
495496

496497

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This project has the following dependencies:
3333

3434
* `ruby` 2.5 or higher
3535
* A compiler like `g++` (on OSX, `clang` works; on Cygwin, use the `mingw-gcc-c++` package)
36-
* `python` (if using a board architecutre that requires it, e.g. ESP32, ESP8266; see [this issue](https://github.com/Arduino-CI/arduino_ci/issues/235#issuecomment-739629243)). Consider `pyserial` as well.
36+
* `python` (if using a board architecture that requires it, e.g. ESP32, ESP8266; see [this issue](https://github.com/Arduino-CI/arduino_ci/issues/235#issuecomment-739629243)). Consider `pyserial` as well.
3737

3838
In that environment, you can install by running `gem install arduino_ci`. To update to a latest version, use `gem update arduino_ci`.
3939

@@ -51,7 +51,7 @@ Arduino expects all libraries to be in a specific `Arduino/libraries` directory
5151
5252
### Changes to Your Repository
5353

54-
Unit testing binaries created by `arduino_ci` should not be commited to the codebase. To avoid that, add the following to your `.gitignore`:
54+
Unit testing binaries created by `arduino_ci` should not be committed to the codebase. To avoid that, add the following to your `.gitignore`:
5555

5656
```ignore-list
5757
# arduino_ci unit test binaries and artifacts

REFERENCE.md

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

33
All tests are run via the same command: `bundle exec arduino_ci.rb`.
44

5-
This script is responsible for detecting and runing all unit tests, on every combination of Arduino platform and C++ compiler. This is followed by attempting to detect and build every example on every "default" Arduino platform.
5+
This script is responsible for detecting and running all unit tests, on every combination of Arduino platform and C++ compiler. This is followed by attempting to detect and build every example on every "default" Arduino platform.
66

77
As a prerequisite, all Arduino "default" platforms are installed if they are not already available.
88

@@ -398,7 +398,7 @@ unittest(pin_read_history)
398398
bool bigEndian = true;
399399
state->digitalPin[1].fromAscii("Yo", bigEndian);
400400
401-
// digitial history as serial data, big-endian
401+
// digital history as serial data, big-endian
402402
bool expectedBits[16] = {
403403
0, 1, 0, 1, 1, 0, 0, 1, // Y
404404
0, 1, 1, 0, 1, 1, 1, 1 // o
@@ -515,7 +515,7 @@ For additional complexity, there are some cases where you want to use a pin as a
515515
```C++
516516
int myPin = 3;
517517
518-
// digitial history as serial data, big-endian
518+
// digital history as serial data, big-endian
519519
bool bigEndian = true;
520520
bool binaryAscii[24] = {
521521
0, 1, 0, 1, 1, 0, 0, 1, // Y

SampleProjects/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Arduino Sample Projects
22
=======================
33

4-
This directory contains projects that are intended solely for testing the various features of this gem -- to test the testing framework itself. The RSpec tests refer specifically to these projects, and as a result _some are explicity designed to fail_.
4+
This directory contains projects that are intended solely for testing the various features of this gem -- to test the testing framework itself. The RSpec tests refer specifically to these projects, and as a result _some are explicitly designed to fail_.
55

66
> **If you are a first-time `arduino_ci` user an are looking for an example to copy from, see [the `Arduino-CI/Blink` repository](https://github.com/Arduino-CI/Blink) instead.**
77
8-
* "TestSomething" contains a minimial library, but tests for all the C++ compilation feature-mocks of arduino_ci.
9-
* "DoSomething" is a simple test of the testing framework (arduino_ci) itself to verfy that passes and failures are properly identified and reported. Because of this, it includes test files that are expected to fail -- they are prefixed with "bad-".
8+
* "TestSomething" contains a minimal library, but tests for all the C++ compilation feature-mocks of arduino_ci.
9+
* "DoSomething" is a simple test of the testing framework (arduino_ci) itself to verify that passes and failures are properly identified and reported. Because of this, it includes test files that are expected to fail -- they are prefixed with "bad-".
1010
* "OnePointOhDummy" is a non-functional library meant to test file inclusion logic on libraries conforming to the "1.0" specification
11-
* "OnePointFiveMalformed" is a non-functional library meant to test file inclusion logic on libraries that attempt to conform to the ["1.5" specfication](https://arduino.github.io/arduino-cli/latest/library-specification/) but fail to include a `src` directory
12-
* "OnePointFiveDummy" is a non-functional library meant to test file inclusion logic on libraries conforming to the ["1.5" specfication](https://arduino.github.io/arduino-cli/latest/library-specification/)
11+
* "OnePointFiveMalformed" is a non-functional library meant to test file inclusion logic on libraries that attempt to conform to the ["1.5" specification](https://arduino.github.io/arduino-cli/latest/library-specification/) but fail to include a `src` directory
12+
* "OnePointFiveDummy" is a non-functional library meant to test file inclusion logic on libraries conforming to the ["1.5" specification](https://arduino.github.io/arduino-cli/latest/library-specification/)
1313
* "DependOnSomething" is a non-functional library meant to test file inclusion logic with dependencies
1414
* "ExcludeSomething" is a non-functional library meant to test directory exclusion logic
1515
* "NetworkLib" tests the Ethernet library

SampleProjects/TestSomething/test/godmode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ unittest(pin_read_history) {
7575
assertEqual(future[5], analogRead(1));
7676

7777
state->digitalPin[1].fromAscii("Yo", true);
78-
// digitial history as serial data, big-endian
78+
// digital history as serial data, big-endian
7979
bool binaryAscii[16] = {
8080
0, 1, 0, 1, 1, 0, 0, 1,
8181
0, 1, 1, 0, 1, 1, 1, 1

SampleProjects/TestSomething/test/pinhistory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ unittest(pin_read_history_bool_to_ascii) {
2222
PinHistory<bool> phb; // pin history bool
2323
phb.fromAscii("Yo", true);
2424

25-
// digitial history as serial data, big-endian
25+
// digital history as serial data, big-endian
2626
bool binaryAscii[16] = {
2727
0, 1, 0, 1, 1, 0, 0, 1,
2828
0, 1, 1, 0, 1, 1, 1, 1};

cpp/arduino/Client.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class Client : public Stream {
77
public:
88
Client() {
9-
// The Stream mock defines a String buffer but never puts anyting in it!
9+
// The Stream mock defines a String buffer but never puts anything in it!
1010
if (!mGodmodeDataIn) {
1111
mGodmodeDataIn = new String;
1212
}

cpp/arduino/HardwareSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//#include <inttypes.h>
44
#include "ci/StreamTape.h"
55

6-
// definitions neeeded for Serial.begin's config arg
6+
// definitions needed for Serial.begin's config arg
77
#define SERIAL_5N1 0x00
88
#define SERIAL_6N1 0x02
99
#define SERIAL_7N1 0x04

cpp/arduino/MockEventQueue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class MockEventQueue {
6060
return ++mSize;
6161
}
6262

63-
// fully specfied event
63+
// fully specified event
6464
bool push(const T& v, unsigned long const time) {
6565
Event e = {v, time};
6666
return push(e);

cpp/arduino/SoftwareSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "Stream.h"
44
#include "Godmode.h"
55

6-
// definitions neeeded for Serial.begin's config arg
6+
// definitions needed for Serial.begin's config arg
77

88
class SoftwareSerial : public Stream
99
{

cpp/arduino/Udp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class UDP : public Stream {
99

1010
public:
1111
UDP() {
12-
// The Stream mock defines a String buffer but never puts anyting in it!
12+
// The Stream mock defines a String buffer but never puts anything in it!
1313
if (!mGodmodeDataIn) {
1414
mGodmodeDataIn = new String;
1515
}

cpp/arduino/ci/ObservableDataStream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DataStreamObserver {
4242
onByte(aByte);
4343
}
4444

45-
// entry poitn for bit-related handler
45+
// entry point for bit-related handler
4646
void handleBit(bool aBit) {
4747
onBit(aBit);
4848

cpp/arduino/ci/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The parent directory is for files that must stand in for their Arduino counterparts -- any `SomeFile` that might be requested as `#include <SomeFile.h>`.
22

3-
This directory is specificially for support files required by those other files. That's because we don't want to create collisions on filenames for common data structures like Queue.
3+
This directory is specifically for support files required by those other files. That's because we don't want to create collisions on filenames for common data structures like Queue.
44

55
If there end up being class-level conflicts, it is this developer's stated intention to rename our classes such that `class Float` becomes `class FloatyMcFloatFace`.

cpp/arduino/ci/Table.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ArduinoCITable {
1515

1616
Node* mStart;
1717
unsigned long mSize;
18-
// to alow const reference signatures, pre-allocate nil values
18+
// to allow const reference signatures, pre-allocate nil values
1919
K mNilK;
2020
V mNilV;
2121

exe/arduino_ci.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def self.parse(options)
5959
puts
6060
puts "Additionally, the following environment variables control the script:"
6161
puts " - #{VAR_CUSTOM_INIT_SCRIPT} - if set, this script will be run from the Arduino/libraries directory"
62-
puts " prior to any automated library installation or testing (e.g. to install unoffical libraries)"
62+
puts " prior to any automated library installation or testing (e.g. to install unofficial libraries)"
6363
puts " - #{VAR_USE_SUBDIR} - if set, the script will install the library from this subdirectory of the cwd"
6464
puts " - #{VAR_EXPECT_EXAMPLES} - if set, testing will fail if no example sketches are present"
6565
puts " - #{VAR_EXPECT_UNITTESTS} - if set, testing will fail if no unit tests are present"

lib/arduino_ci/arduino_downloader.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def self.downloader
7474
# The technology that will be used to extract the download
7575
# (for logging purposes)
7676
# @return [string]
77-
def self.extracter
77+
def self.extractor
7878
self.must_implement(__method__)
7979
end
8080

@@ -150,7 +150,7 @@ def execute
150150
if File.exist?(self.class.extracted_file)
151151
@output.puts "#{arduino_package} seems to have been extracted already at #{self.class.extracted_file}"
152152
elsif File.exist?(package_file)
153-
@output.print "Extracting archive with #{self.class.extracter}"
153+
@output.print "Extracting archive with #{self.class.extractor}"
154154
self.class.extract(package_file)
155155
@output.puts
156156
end

lib/arduino_ci/arduino_downloader_linux.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def self.existing_executable
2626
# Make any preparations or run any checks prior to making changes
2727
# @return [string] Error message, or nil if success
2828
def prepare
29-
reqs = [self.class.extracter]
29+
reqs = [self.class.extractor]
3030
reqs.each do |req|
3131
return "#{req} does not appear to be installed!" unless Host.which(req)
3232
end
@@ -36,14 +36,14 @@ def prepare
3636
# The technology that will be used to extract the download
3737
# (for logging purposes)
3838
# @return [string]
39-
def self.extracter
39+
def self.extractor
4040
"tar"
4141
end
4242

4343
# Extract the package_file to extracted_file
4444
# @return [bool] whether successful
4545
def self.extract(package_file)
46-
system(extracter, "xf", package_file, extracted_file)
46+
system(extractor, "xf", package_file, extracted_file)
4747
end
4848

4949
end

lib/arduino_ci/arduino_downloader_osx.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def self.existing_executable
2626
# Make any preparations or run any checks prior to making changes
2727
# @return [string] Error message, or nil if success
2828
def prepare
29-
reqs = [self.class.extracter]
29+
reqs = [self.class.extractor]
3030
reqs.each do |req|
3131
return "#{req} does not appear to be installed!" unless Host.which(req)
3232
end
@@ -36,14 +36,14 @@ def prepare
3636
# The technology that will be used to extract the download
3737
# (for logging purposes)
3838
# @return [string]
39-
def self.extracter
39+
def self.extractor
4040
"tar"
4141
end
4242

4343
# Extract the package_file to extracted_file
4444
# @return [bool] whether successful
4545
def self.extract(package_file)
46-
system(extracter, "xf", package_file, extracted_file)
46+
system(extractor, "xf", package_file, extracted_file)
4747
end
4848

4949
end

lib/arduino_ci/arduino_downloader_windows.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def self.existing_executable
3737
# The technology that will be used to extract the download
3838
# (for logging purposes)
3939
# @return [string]
40-
def self.extracter
40+
def self.extractor
4141
"Expand-Archive"
4242
end
4343

lib/arduino_ci/cpp_library.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def libasan?(gcc_binary)
274274

275275
# Get a list of all CPP source files in a directory and its subdirectories
276276
# @param some_dir [Pathname] The directory in which to begin the search
277-
# @param extensions [Array<Sring>] The set of allowable file extensions
277+
# @param extensions [Array<String>] The set of allowable file extensions
278278
# @return [Array<Pathname>] The paths of the found files
279279
def code_files_in(some_dir, extensions)
280280
raise ArgumentError, 'some_dir is not a Pathname' unless some_dir.is_a? Pathname
@@ -290,7 +290,7 @@ def code_files_in(some_dir, extensions)
290290

291291
# Get a list of all CPP source files in a directory and its subdirectories
292292
# @param some_dir [Pathname] The directory in which to begin the search
293-
# @param extensions [Array<Sring>] The set of allowable file extensions
293+
# @param extensions [Array<String>] The set of allowable file extensions
294294
# @return [Array<Pathname>] The paths of the found files
295295
def code_files_in_recursive(some_dir, extensions)
296296
raise ArgumentError, 'some_dir is not a Pathname' unless some_dir.is_a? Pathname
@@ -352,7 +352,7 @@ def exclude_dir
352352
@exclude_dirs.map { |p| Pathname.new(path) + p }.select(&:exist?)
353353
end
354354

355-
# The directory where we expect to find unit test defintions provided by the user
355+
# The directory where we expect to find unit test definitions provided by the user
356356
# @return [Pathname]
357357
def tests_dir
358358
Pathname.new(path) + "test"
@@ -421,7 +421,7 @@ def arduino_library_src_dirs(aux_libraries)
421421

422422
# GCC command line arguments for including aux libraries
423423
#
424-
# This function recursively collects the library directores of the dependencies
424+
# This function recursively collects the library directories of the dependencies
425425
#
426426
# @param aux_libraries [Array<Pathname>] The external Arduino libraries required by this project
427427
# @return [Array<String>] The GCC command-line flags necessary to include those libraries

0 commit comments

Comments
 (0)