Skip to content

Commit

Permalink
Add reviewdog for AutoCorrect result.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Aug 2, 2023
1 parent 0848038 commit 1a1ea1d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 46 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/autocorrect-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
with:
node-version-file: ".nvmrc"
cache: yarn
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.14.2

- name: Install NPM
run: |
Expand All @@ -48,20 +51,12 @@ jobs:
DIFF_DOCUMENTS=$(echo "${DIFF_DOCUMENTS}" | egrep -i "^(files|docs)/zh-cn/" | xargs)
echo "DIFF_DOCUMENTS=${DIFF_DOCUMENTS}" >> $GITHUB_ENV
- name: AutoCorrect lint changed content
id: run_lint
- name: AutoCorrect Lint
if: ${{ env.DIFF_DOCUMENTS }}
run: yarn autocorrect --lint --no-diff-bg-color ${{ env.DIFF_DOCUMENTS }}

# https://docs.github.com/en/actions/managing-issues-and-pull-requests/commenting-on-an-issue-when-a-label-is-added
- name: Report Result
- name: AutoCorrect Lint Reports
if: failure()
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
[AutoCorrect](https://github.com/huacnlee/autocorrect) lint failure:
```diff
${{ steps.run_lint.outputs.result }}
```
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn -s autocorrect --format rdjson --lint ${{ env.DIFF_DOCUMENTS }} | reviewdog -f=rdjson -reporter=github-pr-review
2 changes: 1 addition & 1 deletion files/zh-cn/glossary/accent/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: Glossary/Accent

**强调色**(accent)通常为一种明亮的颜色,与颜色方案中更实用的背景和前景色形成对比。这些颜色存在于很多平台(但不是所有平台)的视觉样式中。

web 上,强调色有时用于 {{HTMLElement("input")}} 元素中控件的活跃部分,例如勾选的[复选框](/zh-CN/docs/Web/HTML/Element/input/checkbox)的背景。
web上,强调色有时用于{{HTMLElement("input")}} 元素中控件的活跃部分,例如勾选的[复选框](/zh-CN/docs/Web/HTML/Element/input/checkbox)的背景。

Check failure on line 10 in files/zh-cn/glossary/accent/index.md

View workflow job for this annotation

GitHub Actions / lint

[rdjson] reported by reviewdog 🐶 Raw Output: location:{path:"files/zh-cn/glossary/accent/index.md" range:{start:{line:10 column:1} end:{line:10 column:49}}} severity:ERROR source:{name:"AutoCorrect Lint" url:"https://github.com/huacnlee/autocorrect"} code:{value:"AutoCorrect" url:"https://github.com/huacnlee/autocorrect"} suggestions:{range:{start:{line:10 column:1} end:{line:10 column:49}} text:"在 web 上,强调色有时用于{{HTMLElement("}

## 参见

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/glossary/challenge/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ slug: Glossary/Challenge

{{GlossarySidebar}}

在安全协议中,_质询_(challenge是服务器将某些数据发送到客户端,以便每次生成不同的响应。质询-响应认证协议是防御[重放攻击](https://zh.wikipedia.org/wiki/重放攻击)的一种方法。在重放攻击中,攻击者侦听先前的消息,并在以后的时间重新发送它们以获取与原始消息相同的凭据。
在安全协议中,_质询_(challenge)是服务器将某些数据发送到客户端,以便每次生成不同的响应。质询-响应认证协议是防御[重放攻击](https://zh.wikipedia.org/wiki/重放攻击)的一种方法。在重放攻击中,攻击者侦听先前的消息,并在以后的时间重新发送它们,以获取与原始消息相同的凭据。

Check failure on line 8 in files/zh-cn/glossary/challenge/index.md

View workflow job for this annotation

GitHub Actions / lint

[rdjson] reported by reviewdog 🐶 Raw Output: location:{path:"files/zh-cn/glossary/challenge/index.md" range:{start:{line:8 column:1} end:{line:8 column:161}}} severity:ERROR source:{name:"AutoCorrect Lint" url:"https://github.com/huacnlee/autocorrect"} code:{value:"AutoCorrect" url:"https://github.com/huacnlee/autocorrect"} suggestions:{range:{start:{line:8 column:1} end:{line:8 column:161}} text:"在安全协议中,_质询_(challenge) 是服务器将某些数据发送到客户端,以便每次生成不同的响应。质询 - 响应认证协议是防御"}

Check failure on line 8 in files/zh-cn/glossary/challenge/index.md

View workflow job for this annotation

GitHub Actions / lint

[rdjson] reported by reviewdog 🐶 Raw Output: location:{path:"files/zh-cn/glossary/challenge/index.md" range:{start:{line:8 column:105} end:{line:8 column:259}}} severity:ERROR source:{name:"AutoCorrect Lint" url:"https://github.com/huacnlee/autocorrect"} code:{value:"AutoCorrect" url:"https://github.com/huacnlee/autocorrect"} suggestions:{range:{start:{line:8 column:105} end:{line:8 column:259}} text:"的一种方法。在重放攻击中,攻击者侦听先前的消息,并在以后的时间重新发送它们,以获取与原始消息相同的凭据。"}

[HTTP 认证协议](/zh-CN/docs/Web/HTTP/Authentication)是基于质询-响应认证协议的,尽管“Basic”协议未使用实际的质询(realm 始终相同)。
[HTTP 认证协议](/zh-CN/docs/Web/HTTP/Authentication)是基于质询-响应认证协议的,尽管“Basic”协议未使用实际的质询(realm始终相同)。

Check failure on line 10 in files/zh-cn/glossary/challenge/index.md

View workflow job for this annotation

GitHub Actions / lint

[rdjson] reported by reviewdog 🐶 Raw Output: location:{path:"files/zh-cn/glossary/challenge/index.md" range:{start:{line:10 column:49} end:{line:10 column:162}}} severity:ERROR source:{name:"AutoCorrect Lint" url:"https://github.com/huacnlee/autocorrect"} code:{value:"AutoCorrect" url:"https://github.com/huacnlee/autocorrect"} suggestions:{range:{start:{line:10 column:49} end:{line:10 column:162}} text:"是基于质询 - 响应认证协议的,尽管“Basic”协议未使用实际的质询(realm 始终相同)。"}

## 参见

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"autocorrect-node": "^2.7.1",
"autocorrect-node": "^2.8.4",
"cld": "^2.9.0",
"fdir": "^6.0.1",
"fs-extra": "^11.1.1",
Expand All @@ -40,4 +40,4 @@
"prettier": "3.0.0",
"yargs": "^17.7.2"
}
}
}

Check warning on line 43 in package.json

View workflow job for this annotation

GitHub Actions / prettier

[prettier] reported by reviewdog 🐶 Raw Output: package.json:43:-} package.json:43:+}
62 changes: 34 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,41 @@ astral-regex@^2.0.0:
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31"
integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==

[email protected]:
version "2.7.2"
resolved "https://registry.yarnpkg.com/autocorrect-node-darwin-arm64/-/autocorrect-node-darwin-arm64-2.7.2.tgz#99749c7aa3f35458a8afc0bbabd45d2f5491b72b"
integrity sha512-DdT38wBc6EkvVloxvp4te0oubGZmMlg+q0cA2KYrWPErFUDYOZFN74Pl7DK2/b6PrUJa9LqUxh3u3HM4k/d8bw==

[email protected]:
version "2.7.2"
resolved "https://registry.yarnpkg.com/autocorrect-node-darwin-x64/-/autocorrect-node-darwin-x64-2.7.2.tgz#6c94f82806d26d1222671cba90e10bc089d93ae4"
integrity sha512-xgqN0KAa5tdBKgJ8aSPhvoG5GxSzM1rzE/QuSHYoDN+46nv2loXkXK53nUWQtpoU8NEDbb5MOzQ0r7//1dYeNw==

[email protected]:
version "2.7.2"
resolved "https://registry.yarnpkg.com/autocorrect-node-linux-x64-gnu/-/autocorrect-node-linux-x64-gnu-2.7.2.tgz#3d47cca2848453946c59b62b8e547a7d42b73539"
integrity sha512-8OG2CkIhEc6sLU/luU7FT1BsF2oEtmq9uT0l9ZhjDk1Sbv+ay2eUTNxfIYbj0sTZVqnULEhaepf6mQSsKpjptQ==

[email protected]:
version "2.7.2"
resolved "https://registry.yarnpkg.com/autocorrect-node-win32-x64-msvc/-/autocorrect-node-win32-x64-msvc-2.7.2.tgz#fb162ed1b6e4f7f3342e0b335446526bda537afd"
integrity sha512-++F9/UqxW0tLgIeqhoAhGAoPDHRFUEiDwGUIpWKpnk6S+gu1akUStvp+6lt/48IsfgU1SU3vftY3FT3c59KoZQ==

autocorrect-node@^2.7.1:
version "2.7.2"
resolved "https://registry.yarnpkg.com/autocorrect-node/-/autocorrect-node-2.7.2.tgz#cbfde9d5b0b28d6d936b0d5c0326213c4b7a0711"
integrity sha512-gy9DqWJm2gi3mZiB5tC+SzOEWyuVqDO3QMtKfg74XQI2X6FptK5J5KQppCeOVwV7wglkt48FKpjfyISWuB407g==
[email protected]:
version "2.8.4"
resolved "https://registry.yarnpkg.com/autocorrect-node-darwin-arm64/-/autocorrect-node-darwin-arm64-2.8.4.tgz#b763bdd67a361149eae5802d89bf3454fa34cc65"
integrity sha512-eJFsrZZZUJVPTbdA6hAmVUbTBaznIfkIwstcfn02CXLVKq15j00CXkNytQIdmKpBraTmxjub9kQvYY0Nz2h4DQ==

[email protected]:
version "2.8.4"
resolved "https://registry.yarnpkg.com/autocorrect-node-darwin-x64/-/autocorrect-node-darwin-x64-2.8.4.tgz#d5102b555d08f02ed1f9db1c0882d91d4b829c4b"
integrity sha512-3QheEz2VgZnJcId7zgzbyC88CSmyHg+F93Bw5wsf7dTSwhVdnXeIIlYtXzFabp+c2aCi9lRAQkHFC9Om1CYkuQ==

[email protected]:
version "2.8.4"
resolved "https://registry.yarnpkg.com/autocorrect-node-linux-x64-gnu/-/autocorrect-node-linux-x64-gnu-2.8.4.tgz#5706ef15f099da62897d350e8c14c5ac4a00650c"
integrity sha512-0nR3VnxpfU6HINQiZjC2cz1YVxOTCn529VPqHsWz2H03BPbS9YskGzbRpujnLvwLCyyDlYXJJneFYD1G+9VPaA==

[email protected]:
version "2.8.4"
resolved "https://registry.yarnpkg.com/autocorrect-node-linux-x64-musl/-/autocorrect-node-linux-x64-musl-2.8.4.tgz#8f6df5d6f829028b469f95d9fba4abe899bb852c"
integrity sha512-2LtKtaN6YWUnDtBpo2w5c7FSulozbt2kv9UigrckCX8M/AOVw0MA6uB5snglmKMx1f7fYC06/V4A7Ny1weUOGA==

[email protected]:
version "2.8.4"
resolved "https://registry.yarnpkg.com/autocorrect-node-win32-x64-msvc/-/autocorrect-node-win32-x64-msvc-2.8.4.tgz#968b805b88e3a43a03e012738730b09d7541bec7"
integrity sha512-ExcoBqRjEVnK9n2AVy/dmkiUSnvs5P/VdzI909bCjej1XgOpXonsZ4vGPEPicRfiHb8dc7whl6sh5P/TunDB7A==

autocorrect-node@^2.8.4:
version "2.8.4"
resolved "https://registry.yarnpkg.com/autocorrect-node/-/autocorrect-node-2.8.4.tgz#e94e38b7a333257ff6b627d7ede31209504098a2"
integrity sha512-65DUHJhIUwAlEtyDjYxE94sTT2anQtGXrPB7W9fdrk/Bm7ro4b7mjxQAP14lQlISXXtbNEJO1WABMqNpNbTjxQ==
optionalDependencies:
autocorrect-node-darwin-arm64 "2.7.2"
autocorrect-node-darwin-x64 "2.7.2"
autocorrect-node-linux-x64-gnu "2.7.2"
autocorrect-node-win32-x64-msvc "2.7.2"
autocorrect-node-darwin-arm64 "2.8.4"
autocorrect-node-darwin-x64 "2.8.4"
autocorrect-node-linux-x64-gnu "2.8.4"
autocorrect-node-linux-x64-musl "2.8.4"
autocorrect-node-win32-x64-msvc "2.8.4"

balanced-match@^1.0.0:
version "1.0.2"
Expand Down

0 comments on commit 1a1ea1d

Please sign in to comment.