diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9302716..62878d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@master + - uses: actions/setup-python@v1 + - run: pip install codespell - uses: ./ - - name: Check sort with disorder - run: sort -c test/test.txt || true - + - name: Check codespell + run: codespell test/test.txt || true + - name: Check codespell on an unusually named file + run: codespell test/test:2.txt || true diff --git a/README.md b/README.md index 98e1572..5b399b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# sort-problem-matcher +# codespell-problem-matcher -This problem matcher lets you show errors from GNU `sort` as annotation in +This problem matcher lets you show errors from `codespell` as annotation in GitHub Actions. Based on [korelstar](https://github.com/korelstar)'s [xmllint-problem-matcher](https://github.com/korelstar/xmllint-problem-matcher). @@ -15,8 +15,8 @@ No outputs are generated apart from a configured problem matcher. ## Usage -Add the step to your workflow, before `sort -c` is called. +Add the step to your workflow, before `codespell` is called. ```yaml - - uses: codespell-project/sort-problem-matcher@v1 + - uses: codespell-project/codespell-problem-matcher@v1 ``` diff --git a/action.yml b/action.yml index a2d771f..6d34e83 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ -name: 'sort problem matcher' +name: 'codespell problem matcher' author: 'Peter Newman' -description: 'Shows GNU sort errors as annotation (with file and code line) in GitHub Actions' +description: 'Shows codespell errors as annotation (with file and code line) in GitHub Actions' runs: using: 'node12' main: 'index.js' diff --git a/sort-matcher.json b/codespell-matcher.json similarity index 61% rename from sort-matcher.json rename to codespell-matcher.json index 8b00a6c..4ea7d93 100644 --- a/sort-matcher.json +++ b/codespell-matcher.json @@ -1,10 +1,10 @@ { "problemMatcher": [ { - "owner": "sort-matcher", + "owner": "codespell-matcher", "pattern": [ { - "regexp": "^sort: (.+):(\\d+):\\s+(.+)$", + "regexp": "^(.+):(\\d+):\\s+(.+)$", "file": 1, "line": 2, "message": 3 diff --git a/index.js b/index.js index bfc9fb3..b3552d0 100755 --- a/index.js +++ b/index.js @@ -1,2 +1,2 @@ #!/usr/bin/env node -console.log(`::add-matcher::${__dirname}/sort-matcher.json`); +console.log(`::add-matcher::${__dirname}/codespell-matcher.json`); diff --git a/test/test.txt b/test/test.txt index 95f3767..024f418 100644 --- a/test/test.txt +++ b/test/test.txt @@ -1,3 +1,4 @@ -a -c -b +abandonned +Abandonned +ABANDONNED +AbAnDoNnEd diff --git a/test/test:2.txt b/test/test:2.txt new file mode 100644 index 0000000..50a0985 --- /dev/null +++ b/test/test:2.txt @@ -0,0 +1 @@ +It's ackward when you make a spelling mistake.