-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify formatting of code snippets in CI
- Loading branch information
1 parent
3cf0926
commit 95d031d
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Verify that the code snippets in README.md are formatted. | ||
# The tool https://github.com/hougesen/mdsf is used. | ||
|
||
if [ -n "$(mdsf verify --config .mdsf.json README.md 2>&1)" ]; then | ||
echo "Go code in the README.md is not formatted." | ||
echo "Did you forget to run 'mdsf format README.md'?" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/hougesen/mdsf/main/schemas/v0.4.1/mdsf.schema.json", | ||
"format_finished_document": false, | ||
"languages": { | ||
"go": [ | ||
[ | ||
"gofmt", | ||
"goimports" | ||
] | ||
] | ||
} | ||
} |