Skip to content

Commit 5c67303

Browse files
committed
chore(ci): fetch autocorrect using single-user Nix
port of github.com/mirrorz-org/mirrorz-docs/pull/27 Signed-off-by: definfo <hjsdbb1@gmail.com>
1 parent 6f04556 commit 5c67303

2 files changed

Lines changed: 40 additions & 4 deletions

File tree

.autocorrectrc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# yaml-language-server: $schema=https://huacnlee.github.io/autocorrect/schema.json
2+
rules:
3+
# Auto add spacing between CJK (Chinese, Japanese, Korean) and English words.
4+
# 0 - off, 1 - error, 2 - warning
5+
space-word: 1
6+
# Add space between some punctuations.
7+
space-punctuation: 1
8+
# Add space between brackets (), [] when near the CJK.
9+
space-bracket: 1
10+
# Add space between ``, when near the CJK.
11+
space-backticks: 1
12+
# Add space between dash `-`
13+
space-dash: 1
14+
# Add space between dollar $ when near the CJK.
15+
space-dollar: 0
16+
# Convert to fullwidth.
17+
fullwidth: 1
18+
# To remove space near the fullwidth punctuations.
19+
no-space-fullwidth: 1
20+
# To remove space arouned the fullwidth quotes “”, ''.
21+
no-space-fullwidth-quote: 1
22+
# Fullwidth alphanumeric characters to halfwidth.
23+
halfwidth-word: 1
24+
# Fullwidth punctuations to halfwidth in english.
25+
halfwidth-punctuation: 1
26+
# Spellcheck
27+
spellcheck: 0
28+
# Enable or disable in spatial context
29+
context:
30+
# Enable or disable to format codeblock in Markdown or AsciiDoc etc.
31+
codeblock: 1

.github/workflows/autocorrect.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check source code
16-
uses: actions/checkout@v3
17-
16+
uses: actions/checkout@v5
17+
with:
18+
persist-credentials: false
19+
- name: Setup Nix
20+
uses: nixbuild/nix-quick-install-action@1f095fee853b33114486cfdeae62fa099cda35a9 # v33
1821
- name: AutoCorrect check
1922
run: |
20-
curl -sSL https://git.io/JcGER | sudo bash
21-
autocorrect --lint --no-diff-bg-color $(git diff --diff-filter=AM --name-only ${{ github.event.pull_request.base.sha }})
23+
nix run nixpkgs#autocorrect -- \
24+
--lint \
25+
--no-diff-bg-color \
26+
$(git diff --diff-filter=AM --name-only ${{ github.event.pull_request.base.sha }})

0 commit comments

Comments
 (0)