File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 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 1515 uses : actions/setup-go@v5
1616 with :
1717 go-version : ${{ matrix.go_version }}
18+ - uses : actions/setup-node@v4
1819 - run : ./.ci.gogenerate.sh
1920 - run : ./.ci.gofmt.sh
2021 - run : ./.ci.govet.sh
3738 with :
3839 go-version : ${{ matrix.go_version }}
3940 - 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