Skip to content

Commit 3d12bb7

Browse files
Super linter (#317)
* Adding super-linter CI * Adding comment to changelog * Linting update to changelog * Revert "Linting update to changelog" This reverts commit b8bd474. * Beginning to test CPP, Markdown and YAML linters * Linting for consistency for markdown * Complete rules for cpplint * Remove ruby linting * Fixing file name * Explicitly state the config file * Try json format for config file * Clean up and testing a new path * Needed linter rules root path with the new custom config * Trying a different config option * Cleaned up the file endings * Removing a few linter changes. * Removing more linting changes
1 parent cef0f02 commit 3d12bb7

File tree

9 files changed

+67
-7
lines changed

9 files changed

+67
-7
lines changed

Diff for: .github/workflows/linter.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Lint Code Base
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: Lint Code Base
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: Lint Code Base
24+
uses: github/super-linter/slim@v4
25+
env:
26+
VALIDATE_ALL_CODEBASE: true
27+
FILTER_REGEX_EXCLUDE: ./cpp/arduino/avr/*
28+
DEFAULT_BRANCH: master
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
VALIDATE_CPP: true
31+
VALIDATE_MARKDOWN: true
32+
VALIDATE_YAML: true
33+
LINTER_RULES_PATH: /
34+
MARKDOWN_CONFIG_FILE: /.markdown-lint.json

Diff for: .markdown-lint.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"blanks-around-fences": false,
3+
"blanks-around-headings": false,
4+
"blanks-around-lists": false,
5+
"commands-show-output": false,
6+
"first-line-h1": false,
7+
"header-increment": false,
8+
"line_length": {
9+
"line_length": 600
10+
},
11+
"no-bare-urls": false,
12+
"no-duplicate-heading": false,
13+
"no-multiple-blanks": {
14+
"maximum": 2
15+
},
16+
"single-h1": false,
17+
"ul-indent": {
18+
"indent": 4
19+
}
20+
}

Diff for: CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- `--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 lint the code base
1516
- Added a CI workflow to check for spelling errors
1617

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

204205
### Fixed
205-
* `ArduinoQueue` no longer leaks memory
206+
- `ArduinoQueue` no longer leaks memory
206207

207208

208209
## [0.1.21] - 2019-02-07

Diff for: CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ ArduinoCI uses a very standard GitHub workflow.
1111

1212
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):
1313

14-
* `bundle exec rubocop -D .` - code style tests
15-
* `bundle exec rspec` - functional tests
14+
* `bundle exec rubocop -D .` - code style tests
15+
* `bundle exec rspec` - functional tests
1616

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

Diff for: CPPLINT.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set noparent
2+
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
3+
linelength=120

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ gem 'arduino_ci', path: '/path/to/development/dir/for/arduino_ci'
120120
### Installing the Dependencies
121121

122122
Fulfilling the `arduino_ci` library dependency is as easy as running either of these two commands:
123-
```
123+
124+
```console
124125
$ bundle install # adds packages to global library (may require admin rights)
125126
$ bundle install --path vendor/bundle # adds packages to local library
126127
```
127128

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

130131

131-
132132
### Running `arduino_ci.rb` To Test Your Library
133133

134134
With that installed, just the following shell command each time you want the tests to execute:

Diff for: REFERENCE.md

-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ bundle exec arduino_ci.rb
314314
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.
315315

316316

317-
318317
# Mocks of Arduino Hardware Functions
319318

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

Diff for: SampleProjects/DoSomething/test/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ These files are designed to test the testing framework (the Ruby gem) itself, li
44

55
## Naming convention
66

7-
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`).
7+
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`).
88

99
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!).

Diff for: cpp/arduino/avr/CPPLINT.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# The files in this directory have been copied from Arduino.
2+
# This file configures cpplint to ignore all files in this directory.
3+
exclude_files=.*

0 commit comments

Comments
 (0)