From a1828a7b9c6be6babfc5df32d1de3e807673d43c Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 May 2020 15:28:29 +0100 Subject: [PATCH 1/2] Squashed 'codespell-problem-matcher/' changes from b508e1b..9561cf3 9561cf3 Handle with or without trailing space and match error too 087de87 Run the bleeding edge codespell in our test 008fd97 Simplify the match again now we've found the cause of the issue 858bb67 Deal with any trailing whitespace cdf927a Try another way to match warnings, hopefully catching the file 64fa47d Revert "Test if it's the lack of line matching breaking the warning matcher" 994c7ca Test if it's the lack of line matching breaking the warning matcher 29d3ef5 Catch the severity level too and try and fix the filename match 36d53fb Name the problem matchers separately 937ce1f Try two problem matchers in one file. I suspect the owner will need to differ 3e43d61 Try and add a second matcher 0523b36 Add a binary file and test against it, ready for another problem matcher git-subtree-dir: codespell-problem-matcher git-subtree-split: 9561cf35f342868a1642c30d2e337e783338c875 --- .github/workflows/test.yml | 4 +++- codespell-matcher.json | 13 ++++++++++++- test/test.bin | Bin 0 -> 1 bytes 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 test/test.bin diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62878d2..2a05433 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,9 +12,11 @@ jobs: - name: Checkout uses: actions/checkout@master - uses: actions/setup-python@v1 - - run: pip install codespell + - run: pip install git+https://github.com/codespell-project/codespell.git - uses: ./ - name: Check codespell run: codespell test/test.txt || true - name: Check codespell on an unusually named file run: codespell test/test:2.txt || true + - name: Check codespell on a binary file + run: codespell test/test.bin || true diff --git a/codespell-matcher.json b/codespell-matcher.json index 4ea7d93..7e7abfc 100644 --- a/codespell-matcher.json +++ b/codespell-matcher.json @@ -1,7 +1,7 @@ { "problemMatcher": [ { - "owner": "codespell-matcher", + "owner": "codespell-matcher-default", "pattern": [ { "regexp": "^(.+):(\\d+):\\s+(.+)$", @@ -10,6 +10,17 @@ "message": 3 } ] + }, + { + "owner": "codespell-matcher-specified", + "pattern": [ + { + "regexp": "^(ERROR|WARNING):\\s+(.+):\\s+(.+)\\s*$", + "file": 3, + "severity": 1, + "message": 2 + } + ] } ] } diff --git a/test/test.bin b/test/test.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 From c8228007ddaaaa2de616659a66f1e7037184f148 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 May 2020 15:35:23 +0100 Subject: [PATCH 2/2] Add some more test files --- example/example.bin | Bin 0 -> 1 bytes example/example:2.txt | 1 + 2 files changed, 1 insertion(+) create mode 100644 example/example.bin create mode 100644 example/example:2.txt diff --git a/example/example.bin b/example/example.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/example/example:2.txt b/example/example:2.txt new file mode 100644 index 0000000..50a0985 --- /dev/null +++ b/example/example:2.txt @@ -0,0 +1 @@ +It's ackward when you make a spelling mistake.