Skip to content

Super linter #317

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 18 commits into from
Nov 4, 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
34 changes: 34 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Lint Code Base

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

jobs:
build:
name: Lint Code Base
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: Lint Code Base
uses: github/super-linter/slim@v4
env:
VALIDATE_ALL_CODEBASE: true
FILTER_REGEX_EXCLUDE: ./cpp/arduino/avr/*
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_CPP: true
VALIDATE_MARKDOWN: true
VALIDATE_YAML: true
LINTER_RULES_PATH: /
MARKDOWN_CONFIG_FILE: /.markdown-lint.json
20 changes: 20 additions & 0 deletions .markdown-lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"blanks-around-fences": false,
"blanks-around-headings": false,
"blanks-around-lists": false,
"commands-show-output": false,
"first-line-h1": false,
"header-increment": false,
"line_length": {
"line_length": 600
},
"no-bare-urls": false,
"no-duplicate-heading": false,
"no-multiple-blanks": {
"maximum": 2
},
"single-h1": false,
"ul-indent": {
"indent": 4
}
}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `--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 lint the code base
- Added a CI workflow to check for spelling errors

### Changed
Expand Down Expand Up @@ -202,7 +203,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `GodmodeState` now uses timestamped PinHistory for Analog and Digital

### Fixed
* `ArduinoQueue` no longer leaks memory
- `ArduinoQueue` no longer leaks memory


## [0.1.21] - 2019-02-07
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ArduinoCI uses a very standard GitHub workflow.

Pull requests will trigger a Travis CI job. The following two commands will be expected to pass (so you may want to run them locally before opening the pull request):

* `bundle exec rubocop -D .` - code style tests
* `bundle exec rspec` - functional tests
* `bundle exec rubocop -D .` - code style tests
* `bundle exec rspec` - functional tests

If you do not already have a working ruby development environment set up, run the following commands:

Expand Down
3 changes: 3 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set noparent
filter=-build/header_guard, -build/include, -build/include_order, -build/include_subdir, -build/include_what_you_use, -build/namespaces, -legal/copyright, -readability/alt_tokens, -readability/braces, -readability/casting, -readability/fn_size, -readability/inheritance, -readability/todo, -runtime/arrays, -runtime/explicit, -runtime/int, -runtime/printf, -runtime/references, -whitespace
linelength=120
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ gem 'arduino_ci', path: '/path/to/development/dir/for/arduino_ci'
### Installing the Dependencies

Fulfilling the `arduino_ci` library dependency is as easy as running either of these two commands:
```

```console
$ bundle install # adds packages to global library (may require admin rights)
$ bundle install --path vendor/bundle # adds packages to local library
```

This will create a `Gemfile.lock` in your project directory, which you may optionally check into source control. A broader introduction to ruby dependencies is outside the scope of this document.



### Running `arduino_ci.rb` To Test Your Library

With that installed, just the following shell command each time you want the tests to execute:
Expand Down
1 change: 0 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ bundle exec arduino_ci.rb
Note the use of subshell to execute `bundle exec arduino_library_location.rb`. This command simply returns the directory in which Arduino Libraries are (or should be) installed.



# Mocks of Arduino Hardware Functions

Unless your library peforms something general (e.g. a mathematical or string function, a data structure like Queue, etc), you may need to ensure that your code interacts properly with the Arduino hardware. There are a series of mocks to assist in this.
Expand Down
2 changes: 1 addition & 1 deletion SampleProjects/DoSomething/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ These files are designed to test the testing framework (the Ruby gem) itself, li

## Naming convention

Files in this directory are given names that either contains "bad" (if it is expected to fail) or "good" (if it is expected to pass). This provides a signal to `rspec` for how the code is expected to perform (see `spec/cpp_library_spec.rb`).
Files in this directory are given names that either contains "bad" (if it is expected to fail) or "good" (if it is expected to pass). This provides a signal to `rspec` for how the code is expected to perform (see `spec/cpp_library_spec.rb`).

When writing your own tests you should not follow this ("bad" and "good") naming convention. You should write all your tests expecting them to pass (relying on this `DoSomething` test to ensure that failures are actually noticed!).
3 changes: 3 additions & 0 deletions cpp/arduino/avr/CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The files in this directory have been copied from Arduino.
# This file configures cpplint to ignore all files in this directory.
exclude_files=.*