Decentralize style check (#13)
Browse files- .github/workflows/ci-cd.yaml +34 -3
- .mdlrc +2 -0
- .yamllint +23 -0
- markdownlint.rb +20 -0
.github/workflows/ci-cd.yaml
CHANGED
@@ -20,11 +20,42 @@ on:
|
|
20 |
branches: [master]
|
21 |
|
22 |
jobs:
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
unit-tests:
|
27 |
-
needs:
|
28 |
runs-on: ubuntu-latest
|
29 |
strategy:
|
30 |
fail-fast: false
|
|
|
20 |
branches: [master]
|
21 |
|
22 |
jobs:
|
23 |
+
cancel-previous:
|
24 |
+
name: Cancel Previous Runs In Order to Allocate Action Resources Immediately for Current Run
|
25 |
+
if: github.ref != 'refs/heads/master'
|
26 |
+
runs-on: ubuntu-latest
|
27 |
+
steps:
|
28 |
+
- name: Cancel previous
|
29 |
+
uses: styfle/[email protected]
|
30 |
+
with:
|
31 |
+
access_token: ${{ github.token }}
|
32 |
+
|
33 |
+
yaml-lint:
|
34 |
+
name: YAML Style Check
|
35 |
+
runs-on: ubuntu-latest
|
36 |
+
steps:
|
37 |
+
- uses: actions/checkout@v3
|
38 |
+
- uses: actionshub/yamllint@main
|
39 |
+
|
40 |
+
markdown-lint:
|
41 |
+
name: Markdown Style Check
|
42 |
+
runs-on: ubuntu-latest
|
43 |
+
steps:
|
44 |
+
- uses: actions/checkout@v3
|
45 |
+
- uses: actionshub/markdownlint@main
|
46 |
+
|
47 |
+
linkChecker:
|
48 |
+
name: Link Check
|
49 |
+
runs-on: ubuntu-latest
|
50 |
+
steps:
|
51 |
+
- uses: actions/checkout@v3
|
52 |
+
- name: Link Checker
|
53 |
+
uses: lycheeverse/[email protected]
|
54 |
+
with:
|
55 |
+
fail: true
|
56 |
|
57 |
unit-tests:
|
58 |
+
needs: [yaml-lint, markdown-lint, linkChecker]
|
59 |
runs-on: ubuntu-latest
|
60 |
strategy:
|
61 |
fail-fast: false
|
.mdlrc
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
rules "~MD002", "~MD003", "~MD005", "~MD007", "~MD013", "~MD022", "~MD024", "~MD027", "~MD028", "~MD029", "~MD033", "~MD034", "~MD036", "~MD041", "~MD055", "~MD057"
|
2 |
+
style "#{File.dirname(__FILE__)}/markdownlint.rb"
|
.yamllint
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
extends: default
|
3 |
+
rules:
|
4 |
+
line-length:
|
5 |
+
max: 256
|
6 |
+
level: warning
|
7 |
+
document-start: disable
|
8 |
+
braces:
|
9 |
+
forbid: false
|
10 |
+
min-spaces-inside: 0
|
11 |
+
max-spaces-inside: 1
|
12 |
+
min-spaces-inside-empty: -1
|
13 |
+
max-spaces-inside-empty: -1
|
14 |
+
commas:
|
15 |
+
max-spaces-before: -1
|
16 |
+
min-spaces-after: 1
|
17 |
+
max-spaces-after: -1
|
18 |
+
brackets:
|
19 |
+
max-spaces-inside: -1
|
20 |
+
empty-lines:
|
21 |
+
max: 3
|
22 |
+
indentation:
|
23 |
+
spaces: 2
|
markdownlint.rb
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright Jiaqi Liu
|
2 |
+
#
|
3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
# you may not use this file except in compliance with the License.
|
5 |
+
# You may obtain a copy of the License at
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
# See the License for the specific language governing permissions and
|
13 |
+
# limitations under the License.
|
14 |
+
|
15 |
+
all
|
16 |
+
rule 'MD003', style: :setext_with_atx
|
17 |
+
rule 'MD004', style: :sublist
|
18 |
+
rule 'MD013', line_length: 120
|
19 |
+
rule 'MD029', style: :ordered
|
20 |
+
rule 'MD026', punctuation: ".,;:!?"
|