Skip to content

Commit

Permalink
Update to support JS and Vue files
Browse files Browse the repository at this point in the history
  • Loading branch information
darrynten committed Feb 27, 2020
1 parent cad7606 commit 729ccf1
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 17 deletions.
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FROM python:3.7
FROM python:3.7-alpine3.10

LABEL "com.github.actions.name"="Spellcheck Action"
LABEL "com.github.actions.description"="Check spelling of files in repo"
LABEL "com.github.actions.icon"="clipboard"
LABEL "com.github.actions.color"="green"
LABEL "repository"="http://github.com/rojopolis/spellcheck-github-actions"
LABEL "homepage"="http://github.com/actions"
LABEL "maintainer"="rojopolis <[email protected]>"
LABEL "repository"="https://github.com/UnicornGlobal/spellcheck-github-actions"
LABEL "homepage"="https://github.com/actions"

RUN apt-get update && apt-get install -y \
aspell \
Expand All @@ -15,4 +10,4 @@ RUN pip3 install pyspelling
COPY entrypoint.sh /entrypoint.sh
COPY spellcheck.yaml /spellcheck.yaml
COPY wordlist.txt /wordlist.txt
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# spellcheck-github-actions
A Github Action that spell checks Python, Markdown, and Text files.

A Github Action that spell checks JavaScript, Vue, Markdown, HTML, and Text files.

This action uses [PySpelling](https://facelessuser.github.io/pyspelling/) to
check source files in the project.

## Configuration

If your repo contains `spellcheck.yaml` it will be used instead of the default config.
See https://facelessuser.github.io/pyspelling/configuration/ for options.
See https://facelessuser.github.io/pyspelling/configuration/ for options.

## Upstream

Based on `rojopolis/spellcheck-github-actions`

That repo was not working for us so we made this fork
11 changes: 11 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Check Spelling (JS, Vue, HTML, Markdown, Text)"
description: "Check spelling in a repo"
branding:
icon: "info"
color: "yellow"
outputs:
changed:
description: "Check code files for spelling errors"
runs:
using: "docker"
image: "Dockerfile"
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
if [ ! -f ./spellcheck.yaml ]; then
echo "spellcheck.yaml not found, using default\n"
cp /spellcheck.yaml .
fi

if [ ! -f ./wordlist.txt ]; then
echo "wordlist.txt not found, using default\n"
cp /wordlist.txt .
fi

pyspelling -c spellcheck.yaml
pyspelling -c spellcheck.yaml
47 changes: 42 additions & 5 deletions spellcheck.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
matrix:
- name: Python
- name: JavaScript
sources:
- '**/*.py'
- '**/*.js'
expect_match: false
aspell:
lang: en
dictionary:
Expand All @@ -10,16 +11,37 @@ matrix:
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.python:
- pyspelling.filters.javascript:
comments: true
docstrings: true
group_comments: false
decode_escapes: true
strings: false
string_types: fu
- name: Vue
sources:
- '**/*.vue'
expect_match: false
aspell:
lang: en
dictionary:
wordlists:
- wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.javascript:
comments: true
docstrings: true
group_comments: false
decode_escapes: true
strings: false
string_types: fu
- pyspelling.filters.html:
- pyspelling.filters.stylesheets:
- name: Markdown
apsell:
mode: none
mode: en
dictionary:
wordlists:
- wordlist.txt
Expand All @@ -30,14 +52,29 @@ matrix:
- pyspelling.filters.html:
sources:
- '**/*.md'
expect_match: false
- name: HTML
apsell:
mode: en
dictionary:
wordlists:
- wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.html:
sources:
- '**/*.html'
expect_match: false
- name: Text
sources:
- '**/*.txt'
expect_match: false
dictionary:
wordlists:
- wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.text:
convert_encoding: utf-8
convert_encoding: utf-8

0 comments on commit 729ccf1

Please sign in to comment.