File tree 3 files changed +27
-0
lines changed
3 files changed +27
-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 README.md'?"
9
+ exit 1
10
+ fi
Original file line number Diff line number Diff line change @@ -15,10 +15,15 @@ jobs:
15
15
uses : actions/setup-go@v5
16
16
with :
17
17
go-version : ${{ matrix.go_version }}
18
+ - uses : actions/setup-node@v4
19
+ - name : Install mdsf to check formatting of code snippets in markdown files
20
+ run : npm install -g mdsf-cli
18
21
- run : ./.ci.gogenerate.sh
19
22
- run : ./.ci.gofmt.sh
20
23
- run : ./.ci.govet.sh
21
24
- run : go test -v -race ./...
25
+ - name : Verify formatting of code snippets in README.md
26
+ run : ./.ci.readme.fmt.sh
22
27
test :
23
28
runs-on : ubuntu-latest
24
29
strategy :
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