File tree 3 files changed +35
-0
lines changed
3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Verify that the code snippets in README.md are formatted.
4
+ # The tool https://github.com/hougesen/mdsf is used.
5
+
6
+ if [ -n " $( mdsf verify --config .mdsf.json README.md 2>&1 ) " ]; then
7
+ echo " Go code in the README.md is not formatted."
8
+ echo " Did you forget to run 'mdsf format --config .mdsf.json README.md'?"
9
+ exit 1
10
+ fi
Original file line number Diff line number Diff line change 15
15
uses : actions/setup-go@v5
16
16
with :
17
17
go-version : ${{ matrix.go_version }}
18
+ - uses : actions/setup-node@v4
18
19
- run : ./.ci.gogenerate.sh
19
20
- run : ./.ci.gofmt.sh
20
21
- run : ./.ci.govet.sh
37
38
with :
38
39
go-version : ${{ matrix.go_version }}
39
40
- run : go test -v -race ./...
41
+ format :
42
+ name : Check formatting of code snippets in markdown files
43
+ runs-on : ubuntu-latest
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+ - name : Setup Go
47
+ uses : actions/setup-go@v5
48
+ with :
49
+ go-version : stable
50
+ - run : npm install -g mdsf-cli
51
+ - run : ./.ci.gofmt.sh
52
+ - run : ./.ci.readme.fmt.sh
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " https://raw.githubusercontent.com/hougesen/mdsf/main/schemas/v0.4.1/mdsf.schema.json" ,
3
+ "format_finished_document" : false ,
4
+ "languages" : {
5
+ "go" : [
6
+ [
7
+ " gofmt" ,
8
+ " goimports"
9
+ ]
10
+ ]
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments