diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e74e04c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false + +[*.{vue,js,scss}] +indent_size = 2 +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml,xml,xml.dist}] +indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml index 815a32a..74dc097 100644 --- a/.github/workflows/lint-md.yml +++ b/.github/workflows/lint-md.yml @@ -1,6 +1,6 @@ name: lint markdown -on: [push, pull_request] +on: [workflow_dispatch, push, pull_request] jobs: lint-markdown: @@ -12,18 +12,14 @@ jobs: - name: Set node version uses: actions/setup-node@v4 - - name: Install dependencies - run: npm install + - name: Install lint-md + run: npm install @lint-md/cli -g - - name: Lint markdown - run: npm run md-fix + - name: Install zhlint + run: npm install zhlint -g - - name: Lint zh_CN - run: npm run zh-fix + - name: Lint markdown + run: lint-md 'README.md' --config=.lintmdrc --threads - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_options: '--no-verify' - commit_message: Fix markdown - file_pattern: '*.md */*.md */*/*.md' +# - name: Lint zh_CN +# run: zhlint 'README.md' --config=.zhlintrc diff --git a/.lintmdrc b/.lintmdrc index b82ea52..a16c496 100644 --- a/.lintmdrc +++ b/.lintmdrc @@ -1,19 +1,35 @@ { "excludeFiles": [ - "src/", - "tests/", - "vendor/" + "./.build/**", + "./.github/**", + "./node_modules/**", + "./vendor/**", + "./vendor-bin/**" ], "rules": { - "no-empty-code": 1, + "space-around-alphabet": 2, + "space-around-number": 2, + "no-empty-code-lang": 2, + "no-empty-url": 2, + "no-empty-list": 2, + "no-empty-code": 2, + "no-empty-inline-code": 2, + "no-empty-blockquote": 2, + "no-special-characters": 2, + "use-standard-ellipsis": 2, + "no-fullwidth-number": 2, + "no-space-in-link": 2, + "no-multiple-space-blockquote": 2, + "correct-title-trailing-punctuation": 2, + "no-space-in-inline-code": 2, "no-long-code": [ 2, { - "length": 256, + "length": 120, "exclude": [ "dot" ] } ] } -} \ No newline at end of file +} diff --git a/.zhlintignore b/.zhlintignore new file mode 100644 index 0000000..371abdc --- /dev/null +++ b/.zhlintignore @@ -0,0 +1,6 @@ +/.build +/.github +/node_modules +/vendor +/vendor-bin +/传说部分/地方传说/鸠龙岗的来历.md \ No newline at end of file diff --git a/.zhlintrc b/.zhlintrc new file mode 100644 index 0000000..9db6bc5 --- /dev/null +++ b/.zhlintrc @@ -0,0 +1,7 @@ +{ + "preset": "default", + "rules": { + "noSinglePair": false, + "noSpaceBetweenFullwidthContent": false + } +}