From 729ccf160f6e72bd078904cddd5e6244f81ee156 Mon Sep 17 00:00:00 2001 From: Darryn Ten Date: Thu, 27 Feb 2020 14:26:50 +0700 Subject: [PATCH] Update to support JS and Vue files --- Dockerfile | 13 ++++--------- README.md | 12 ++++++++++-- action.yml | 11 +++++++++++ entrypoint.sh | 4 +++- spellcheck.yaml | 47 ++++++++++++++++++++++++++++++++++++++++++----- 5 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 action.yml diff --git a/Dockerfile b/Dockerfile index bcdc85bb..0235dceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " +LABEL "repository"="https://github.com/UnicornGlobal/spellcheck-github-actions" +LABEL "homepage"="https://github.com/actions" RUN apt-get update && apt-get install -y \ aspell \ @@ -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"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index b5133c9d..3f7e6fa3 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +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 diff --git a/action.yml b/action.yml new file mode 100644 index 00000000..6a2f71c4 --- /dev/null +++ b/action.yml @@ -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" diff --git a/entrypoint.sh b/entrypoint.sh index 71e54d6f..258ae2d7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 \ No newline at end of file +pyspelling -c spellcheck.yaml diff --git a/spellcheck.yaml b/spellcheck.yaml index 3cbed0f2..f5cd84d0 100644 --- a/spellcheck.yaml +++ b/spellcheck.yaml @@ -1,7 +1,8 @@ matrix: -- name: Python +- name: JavaScript sources: - - '**/*.py' + - '**/*.js' + expect_match: false aspell: lang: en dictionary: @@ -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 @@ -30,9 +52,24 @@ 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 @@ -40,4 +77,4 @@ matrix: encoding: utf-8 pipeline: - pyspelling.filters.text: - convert_encoding: utf-8 \ No newline at end of file + convert_encoding: utf-8