From 94762b753565e1ea0bbd5507375903fe1d68e190 Mon Sep 17 00:00:00 2001 From: jdkato Date: Wed, 20 Sep 2023 16:02:26 -0700 Subject: [PATCH] Add workflow --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ README.md | 2 +- pkg/Joblint/testdata/test.ct | 2 +- pkg/alex/testdata/test.ct | 2 +- pkg/proselint/testdata/test.ct | 4 ++-- pkg/write-good/testdata/test.ct | 3 +-- 6 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bbf1fd7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Build + Test + +on: push + +jobs: + styles: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "1.20" + + - name: Install Vale + run: | + go install github.com/errata-ai/vale/v2/cmd/vale@latest + echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> $GITHUB_PATH + + - name: Run tests + run: | + go test -v ./pkg \ No newline at end of file diff --git a/README.md b/README.md index a627301..a04d4dc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Styles [![Build Status](https://travis-ci.org/errata-ai/styles.svg?branch=master)](https://travis-ci.org/errata-ai/styles) +# Styles This repository contains a library of all officially supported styles for Vale. The benefits of using these styles over their original implementations include: diff --git a/pkg/Joblint/testdata/test.ct b/pkg/Joblint/testdata/test.ct index ee544cc..1916b7c 100644 --- a/pkg/Joblint/testdata/test.ct +++ b/pkg/Joblint/testdata/test.ct @@ -1,4 +1,4 @@ -$ cdf ${ROOTDIR}/Basic +$ cdf ${ROOTDIR}/basic $ vale --output=line --sort --normalize --relative --no-exit fail.md pass.md real.md fail.md:3:21:Joblint.Profanity:Remove 'fucking' fail.md:3:37:Joblint.TechTerms:Use 'JavaScript' instead of 'java script' diff --git a/pkg/alex/testdata/test.ct b/pkg/alex/testdata/test.ct index f35775b..d2c78bc 100644 --- a/pkg/alex/testdata/test.ct +++ b/pkg/alex/testdata/test.ct @@ -1,3 +1,3 @@ -$ cdf ${ROOTDIR}/Basic +$ cdf ${ROOTDIR}/basic $ vale --output=line --sort --normalize --relative --no-exit fail.md pass.md fail.md:3:21:alex.ProfanityLikely:Don't use 'fucking', it's profane. \ No newline at end of file diff --git a/pkg/proselint/testdata/test.ct b/pkg/proselint/testdata/test.ct index 5014525..40411d9 100644 --- a/pkg/proselint/testdata/test.ct +++ b/pkg/proselint/testdata/test.ct @@ -1,4 +1,4 @@ -$ cdf ${ROOTDIR}/Basic +$ cdf ${ROOTDIR}/basic $ vale --output=line --sort --normalize --relative --no-exit test.md test.md:1:19:proselint.Nonwords:Consider using 'regardless' instead of 'irregardless'. test.md:3:18:proselint.Archaisms:'perchance' is archaic. @@ -35,7 +35,7 @@ test.md:51:27:proselint.Diacritical:Consider using 'Beyoncé' instead of 'Beyonc test.md:51:36:proselint.P-Value:You should use more decimal places, unless 'p = 0.00' is really true. test.md:51:47:proselint.Needless:Prefer 'abolition' over 'abolishment' -$ cdf ${ROOTDIR}/Punctuation +$ cdf ${ROOTDIR}/punctuation $ vale --output=line --sort --normalize --relative --no-exit test.md test.md:3:17:proselint.Hyperbole:'idea!!' is hyperbolic. test.md:8:23:proselint.Hyperbole:'here!!' is hyperbolic. diff --git a/pkg/write-good/testdata/test.ct b/pkg/write-good/testdata/test.ct index 5caa17c..ffc1d07 100644 --- a/pkg/write-good/testdata/test.ct +++ b/pkg/write-good/testdata/test.ct @@ -8,9 +8,8 @@ test.md:3:1:write-good.E-Prime:Try to avoid using 'Here's'. test.md:6:1:write-good.E-Prime:Try to avoid using 'It's'. $ cdf ${ROOTDIR}/Illusions -$ vale --output=line --sort --normalize --relative test.md test.rst +$ vale --output=line --sort --normalize --relative test.md test.md:1:1:write-good.Illusions:'the' is repeated! -test.rst:1:1:write-good.Illusions:'foo' is repeated! $ cdf ${ROOTDIR}/Passive $ vale --output=line --sort --normalize --relative test.md