Skip to content

Commit b508e1b

Browse files
committed
Initial attempt at matching codespell log lines
1 parent 362aa3f commit b508e1b

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@master
14+
- uses: actions/setup-python@v1
15+
- run: pip install codespell
1416
- uses: ./
15-
- name: Check sort with disorder
16-
run: sort -c test/test.txt || true
17-
17+
- name: Check codespell
18+
run: codespell test/test.txt || true
19+
- name: Check codespell on an unusually named file
20+
run: codespell test/test:2.txt || true

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# sort-problem-matcher
1+
# codespell-problem-matcher
22

3-
This problem matcher lets you show errors from GNU `sort` as annotation in
3+
This problem matcher lets you show errors from `codespell` as annotation in
44
GitHub Actions.
55

66
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.
1515

1616
## Usage
1717

18-
Add the step to your workflow, before `sort -c` is called.
18+
Add the step to your workflow, before `codespell` is called.
1919

2020
```yaml
21-
- uses: codespell-project/sort-problem-matcher@v1
21+
- uses: codespell-project/codespell-problem-matcher@v1
2222
```

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: 'sort problem matcher'
1+
name: 'codespell problem matcher'
22
author: 'Peter Newman'
3-
description: 'Shows GNU sort errors as annotation (with file and code line) in GitHub Actions'
3+
description: 'Shows codespell errors as annotation (with file and code line) in GitHub Actions'
44
runs:
55
using: 'node12'
66
main: 'index.js'

sort-matcher.json renamed to codespell-matcher.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"problemMatcher": [
33
{
4-
"owner": "sort-matcher",
4+
"owner": "codespell-matcher",
55
"pattern": [
66
{
7-
"regexp": "^sort: (.+):(\\d+):\\s+(.+)$",
7+
"regexp": "^(.+):(\\d+):\\s+(.+)$",
88
"file": 1,
99
"line": 2,
1010
"message": 3

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env node
2-
console.log(`::add-matcher::${__dirname}/sort-matcher.json`);
2+
console.log(`::add-matcher::${__dirname}/codespell-matcher.json`);

test/test.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
a
2-
c
3-
b
1+
abandonned
2+
Abandonned
3+
ABANDONNED
4+
AbAnDoNnEd

test/test:2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
It's ackward when you make a spelling mistake.

0 commit comments

Comments
 (0)