From e7bfc386675cb8cabc010a18bc59e9db39f7bfd5 Mon Sep 17 00:00:00 2001 From: CHANG Xuben Date: Tue, 17 Dec 2024 19:04:03 +0800 Subject: [PATCH] chore(lint-all): add custom rules for zhlint --- .github/workflows/lint-all.yaml | 4 ++-- .scripts/.zhlintrc | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .scripts/.zhlintrc diff --git a/.github/workflows/lint-all.yaml b/.github/workflows/lint-all.yaml index 685c5da..6d1e66b 100644 --- a/.github/workflows/lint-all.yaml +++ b/.github/workflows/lint-all.yaml @@ -21,13 +21,13 @@ jobs: echo 0 > "$linted_failed_file" find . -type f -name '*.md' | while read -r file; do set +e - zhlint "$file" + zhlint --config "$GITHUB_WORKSPACE"/.scripts/.zhlintrc "$file" if [ $? -ne 0 ]; then echo 1 > "$linted_failed_file" echo "$file" >> "$file_list" output_file="linted_output/report_and_suggested_fixes/$file" mkdir -p "$(dirname "$output_file")" - zhlint "$file" --output="$output_file" > "$output_file.log" 2>&1 + zhlint --config "$GITHUB_WORKSPACE"/.scripts/.zhlintrc "$file" --output="$output_file" > "$output_file.log" 2>&1 fi set -e done diff --git a/.scripts/.zhlintrc b/.scripts/.zhlintrc new file mode 100644 index 0000000..e3ac6ce --- /dev/null +++ b/.scripts/.zhlintrc @@ -0,0 +1,6 @@ +{ + "preset": "default", + "rules": { + "halfwidthPunctuation": "(),。、" + } +} \ No newline at end of file