Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit e19258e

Browse files
committed
Add libraries/spell-check example
1 parent c78f1dc commit e19258e

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ available to your Workflows.
1313

1414
* [setup-taskfile](./setup-taskfile) makes [`task`](https://taskfile.dev/#/)
1515
available to your Workflows.
16+
17+
* [libraries/compile-examples](./libraries/compile-examples) compile all the examples in an Arduino Library
18+
19+
* [libraries/spell-check](./libraries/spell-check) run spell checker on Arduino Library source and examples

libraries/spell-check/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Container image that runs your code
2+
FROM ubuntu:latest
3+
4+
# Install prerequisites
5+
RUN apt-get update && apt-get install -y python3 python3-pip
6+
CMD /bin/bash
7+
8+
RUN pip3 install codespell
9+
CMD /bin/bash
10+
11+
# Copies your code file from your action repository to the filesystem path `/` of the container
12+
COPY entrypoint.sh /entrypoint.sh
13+
14+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
15+
ENTRYPOINT ["/entrypoint.sh"]

libraries/spell-check/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# libraries/spell-check action
2+
3+
Runs codespell on library source code and examples contained in the library.
4+
5+
## Inputs
6+
7+
### `ignore-words-list`
8+
9+
File path of list of words to ignore.
10+
11+
## Example usage
12+
13+
```yaml
14+
uses: arduino/actions/libraries/spell-check@master
15+
```

libraries/spell-check/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Arduino Libraries - Spell Check'
2+
description: 'Runs codespell on library source code and examples contained in the library'
3+
inputs:
4+
ignore-words-list:
5+
description: 'File path of list of words to ignore'
6+
default: ''
7+
runs:
8+
using: 'docker'
9+
image: 'Dockerfile'
10+
args:
11+
- ${{ inputs.ignore-words-list }}

libraries/spell-check/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -x
2+
3+
IGNORE_WORDS_LIST=$1
4+
5+
CODE_SPELL_ARGS="--skip=.git"
6+
7+
if test -f "$IGNORE_WORDS_LIST"; then
8+
CODE_SPELL_ARGS="${CODE_SPELL_ARGS} --ignore-words=${IGNORE_WORDS_LIST}"
9+
fi
10+
11+
codespell ${CODE_SPELL_ARGS} .

0 commit comments

Comments
 (0)