Skip to content

Commit d2fe1fe

Browse files
author
robot
committed
ci: mdl
1 parent 570779b commit d2fe1fe

File tree

5 files changed

+160
-46
lines changed

5 files changed

+160
-46
lines changed

.github/workflows/check-format.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// const util = require("util");
2+
// const glob = util.promisify(require('glob'));
3+
// const fs = require("fs").promises;
4+
// const path = require('path');
5+
6+
7+
// async function main() {
8+
// var errors = [];
9+
// var directories = await glob(__dirname + '../../**/*.md');
10+
11+
// for (var filePath of directories) {
12+
// var data = await fs.readFile(filePath, 'utf8');
13+
// var filename = path.parse(filePath).base.replace(".md", "");
14+
15+
// // do check
16+
// }
17+
18+
// if (errors.length > 0) {
19+
// for (var error of errors) {
20+
// console.error(error + "\n");
21+
// }
22+
23+
// var message = `Found ${errors.length} errors! Please fix!`;
24+
// throw new Error(message);
25+
// }
26+
// }
27+
28+
// main();
29+
30+
console.log('TO BE IMPLEMENTED')

.github/workflows/ci.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
markdown-lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: "16"
15+
cache: "npm"
16+
- name: Install packages
17+
run: sudo gem install mdl
18+
- name: Get file changes
19+
id: get_file_changes
20+
uses: trilom/[email protected]
21+
with:
22+
output: " "
23+
- name: Echo file changes
24+
run: |
25+
echo Changed files: ${{ steps.get_file_changes.outputs.files }}
26+
- name: Lint markdown files
27+
run: mdl ${{ steps.get_file_changes.outputs.files}}
28+
- run: npm install
29+
- run: node .github/check-format.js
30+
# Suppress 036 Emphasis used instead of a header
31+
# Suppress 024 Multiple headers with the same content

.mdl_style.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all
2+
# 我想让图片居中,单纯的 md 似乎做不到,所以使用 raw html 来实现
3+
exclude_rule 'MD033'
4+
# 仅仅是强调,不需要用 header
5+
exclude_rule 'MD036'
6+
# 这个 rule 有 bug?
7+
exclude_rule 'MD029'

.mdlrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style '.mdl_style.rb'

0 commit comments

Comments
 (0)