Skip to content

Added spelling CI #316

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 8 commits into from
Oct 28, 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
3 changes: 3 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
aci
ba
flem
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = ./cpp/arduino/avr/*
ignore-words=.codespellignore
26 changes: 26 additions & 0 deletions .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is the name of the workflow, visible on GitHub UI
name: Check Spelling

on:
push:
branches-ignore: [master, main]
# Remove the line above to run when pushing to master
pull_request:
branches: [master, main]

jobs:
build:
name: Check Spelling
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Check Spelling
uses: codespell-project/actions-codespell@master
with:
check_filenames: true
19 changes: 10 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Allow use of watchdog timer in application code (though it doesn't do anything)
- Show output from successful compile
- `--min-free-space=N` command-line argument to fail if free space is below requred value
- `--min-free-space=N` command-line argument to fail if free space is below required value
- Add `_BV()` macro.
- Support for `dtostrf()`
- Added a CI workflow to check for spelling errors

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

### Changed
- 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.
- 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.
- Stream::readStreamUntil() no longer returns delimiter

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

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

### Fixed
- Assertions on `nullptr`
- The defintion of `nullptr`
- The definition of `nullptr`


## [0.1.18] - 2019-01-29
Expand Down Expand Up @@ -298,7 +299,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- 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

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


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


## [0.1.5] - 2018-03-05
### Added
- Yaml files can have either `.yml` or `.yaml` extensions
- Yaml files support select/reject critera for paths of unit tests for targeted testing
- Yaml files support select/reject criteria for paths of unit tests for targeted testing
- Pins now track history and can report it in Ascii (big- or little-endian) for digital sequences
- Pins now accept an array (or string) of input bits for providing pin values across multiple reads
- FlashStringHelper (and related macros) compilation mocks
Expand Down Expand Up @@ -490,7 +491,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- All test files were reporting "not ok" in TAP output. Now they are OK iff all asserts pass.
- Directories with a C++ extension in their name could cause problems. Now they are ignored.
- `CppLibrary` had trouble with symlinks. It shoudn't anymore.
- `CppLibrary` had trouble with symlinks. It shouldn't anymore.
- `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.


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This project has the following dependencies:

* `ruby` 2.5 or higher
* A compiler like `g++` (on OSX, `clang` works; on Cygwin, use the `mingw-gcc-c++` package)
* `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.
* `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.

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

Expand All @@ -51,7 +51,7 @@ Arduino expects all libraries to be in a specific `Arduino/libraries` directory

### Changes to Your Repository

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

```ignore-list
# arduino_ci unit test binaries and artifacts
Expand Down
6 changes: 3 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

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

Expand Down Expand Up @@ -398,7 +398,7 @@ unittest(pin_read_history)
bool bigEndian = true;
state->digitalPin[1].fromAscii("Yo", bigEndian);

// digitial history as serial data, big-endian
// digital history as serial data, big-endian
bool expectedBits[16] = {
0, 1, 0, 1, 1, 0, 0, 1, // Y
0, 1, 1, 0, 1, 1, 1, 1 // o
Expand Down Expand Up @@ -515,7 +515,7 @@ For additional complexity, there are some cases where you want to use a pin as a
```C++
int myPin = 3;

// digitial history as serial data, big-endian
// digital history as serial data, big-endian
bool bigEndian = true;
bool binaryAscii[24] = {
0, 1, 0, 1, 1, 0, 0, 1, // Y
Expand Down
10 changes: 5 additions & 5 deletions SampleProjects/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Arduino Sample Projects
=======================

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

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

* "TestSomething" contains a minimial library, but tests for all the C++ compilation feature-mocks of arduino_ci.
* "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-".
* "TestSomething" contains a minimal library, but tests for all the C++ compilation feature-mocks of arduino_ci.
* "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-".
* "OnePointOhDummy" is a non-functional library meant to test file inclusion logic on libraries conforming to the "1.0" specification
* "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
* "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/)
* "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
* "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/)
* "DependOnSomething" is a non-functional library meant to test file inclusion logic with dependencies
* "ExcludeSomething" is a non-functional library meant to test directory exclusion logic
* "NetworkLib" tests the Ethernet library
2 changes: 1 addition & 1 deletion SampleProjects/TestSomething/test/godmode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ unittest(pin_read_history) {
assertEqual(future[5], analogRead(1));

state->digitalPin[1].fromAscii("Yo", true);
// digitial history as serial data, big-endian
// digital history as serial data, big-endian
bool binaryAscii[16] = {
0, 1, 0, 1, 1, 0, 0, 1,
0, 1, 1, 0, 1, 1, 1, 1
Expand Down
2 changes: 1 addition & 1 deletion SampleProjects/TestSomething/test/pinhistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ unittest(pin_read_history_bool_to_ascii) {
PinHistory<bool> phb; // pin history bool
phb.fromAscii("Yo", true);

// digitial history as serial data, big-endian
// digital history as serial data, big-endian
bool binaryAscii[16] = {
0, 1, 0, 1, 1, 0, 0, 1,
0, 1, 1, 0, 1, 1, 1, 1};
Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Client : public Stream {
public:
Client() {
// The Stream mock defines a String buffer but never puts anyting in it!
// The Stream mock defines a String buffer but never puts anything in it!
if (!mGodmodeDataIn) {
mGodmodeDataIn = new String;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//#include <inttypes.h>
#include "ci/StreamTape.h"

// definitions neeeded for Serial.begin's config arg
// definitions needed for Serial.begin's config arg
#define SERIAL_5N1 0x00
#define SERIAL_6N1 0x02
#define SERIAL_7N1 0x04
Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/MockEventQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MockEventQueue {
return ++mSize;
}

// fully specfied event
// fully specified event
bool push(const T& v, unsigned long const time) {
Event e = {v, time};
return push(e);
Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/SoftwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Stream.h"
#include "Godmode.h"

// definitions neeeded for Serial.begin's config arg
// definitions needed for Serial.begin's config arg

class SoftwareSerial : public Stream
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/Udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class UDP : public Stream {

public:
UDP() {
// The Stream mock defines a String buffer but never puts anyting in it!
// The Stream mock defines a String buffer but never puts anything in it!
if (!mGodmodeDataIn) {
mGodmodeDataIn = new String;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/ci/ObservableDataStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DataStreamObserver {
onByte(aByte);
}

// entry poitn for bit-related handler
// entry point for bit-related handler
void handleBit(bool aBit) {
onBit(aBit);

Expand Down
2 changes: 1 addition & 1 deletion cpp/arduino/ci/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The parent directory is for files that must stand in for their Arduino counterparts -- any `SomeFile` that might be requested as `#include <SomeFile.h>`.

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

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`.
2 changes: 1 addition & 1 deletion cpp/arduino/ci/Table.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ArduinoCITable {

Node* mStart;
unsigned long mSize;
// to alow const reference signatures, pre-allocate nil values
// to allow const reference signatures, pre-allocate nil values
K mNilK;
V mNilV;

Expand Down
2 changes: 1 addition & 1 deletion exe/arduino_ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def self.parse(options)
puts
puts "Additionally, the following environment variables control the script:"
puts " - #{VAR_CUSTOM_INIT_SCRIPT} - if set, this script will be run from the Arduino/libraries directory"
puts " prior to any automated library installation or testing (e.g. to install unoffical libraries)"
puts " prior to any automated library installation or testing (e.g. to install unofficial libraries)"
puts " - #{VAR_USE_SUBDIR} - if set, the script will install the library from this subdirectory of the cwd"
puts " - #{VAR_EXPECT_EXAMPLES} - if set, testing will fail if no example sketches are present"
puts " - #{VAR_EXPECT_UNITTESTS} - if set, testing will fail if no unit tests are present"
Expand Down
4 changes: 2 additions & 2 deletions lib/arduino_ci/arduino_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def self.downloader
# The technology that will be used to extract the download
# (for logging purposes)
# @return [string]
def self.extracter
def self.extractor
self.must_implement(__method__)
end

Expand Down Expand Up @@ -150,7 +150,7 @@ def execute
if File.exist?(self.class.extracted_file)
@output.puts "#{arduino_package} seems to have been extracted already at #{self.class.extracted_file}"
elsif File.exist?(package_file)
@output.print "Extracting archive with #{self.class.extracter}"
@output.print "Extracting archive with #{self.class.extractor}"
self.class.extract(package_file)
@output.puts
end
Expand Down
6 changes: 3 additions & 3 deletions lib/arduino_ci/arduino_downloader_linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.existing_executable
# Make any preparations or run any checks prior to making changes
# @return [string] Error message, or nil if success
def prepare
reqs = [self.class.extracter]
reqs = [self.class.extractor]
reqs.each do |req|
return "#{req} does not appear to be installed!" unless Host.which(req)
end
Expand All @@ -36,14 +36,14 @@ def prepare
# The technology that will be used to extract the download
# (for logging purposes)
# @return [string]
def self.extracter
def self.extractor
"tar"
end

# Extract the package_file to extracted_file
# @return [bool] whether successful
def self.extract(package_file)
system(extracter, "xf", package_file, extracted_file)
system(extractor, "xf", package_file, extracted_file)
end

end
Expand Down
6 changes: 3 additions & 3 deletions lib/arduino_ci/arduino_downloader_osx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.existing_executable
# Make any preparations or run any checks prior to making changes
# @return [string] Error message, or nil if success
def prepare
reqs = [self.class.extracter]
reqs = [self.class.extractor]
reqs.each do |req|
return "#{req} does not appear to be installed!" unless Host.which(req)
end
Expand All @@ -36,14 +36,14 @@ def prepare
# The technology that will be used to extract the download
# (for logging purposes)
# @return [string]
def self.extracter
def self.extractor
"tar"
end

# Extract the package_file to extracted_file
# @return [bool] whether successful
def self.extract(package_file)
system(extracter, "xf", package_file, extracted_file)
system(extractor, "xf", package_file, extracted_file)
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/arduino_ci/arduino_downloader_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def self.existing_executable
# The technology that will be used to extract the download
# (for logging purposes)
# @return [string]
def self.extracter
def self.extractor
"Expand-Archive"
end

Expand Down
8 changes: 4 additions & 4 deletions lib/arduino_ci/cpp_library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def libasan?(gcc_binary)

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

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

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

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