Skip to content

Commit

Permalink
markdownlint: add -g option to check_format and fix mdl errors
Browse files Browse the repository at this point in the history
-g option using only files known to git, that allow us
to avoid errors from submodules

Also add check if mdl is installed, and gracefull info if not.

Signed-off-by: Maciej Wawryk <[email protected]>
Change-Id: Ib6e1920774ffca81e62d9abebc8d8b4548feb519
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9086
Community-CI: Broadcom CI <[email protected]>
Reviewed-by: Paul Luse <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Monica Kenguva <[email protected]>
Reviewed-by: Aleksey Marchuk <[email protected]>
Reviewed-by: Tomasz Zawadzki <[email protected]>
Reviewed-by: Pawel Piatek <[email protected]>
Tested-by: SPDK CI Jenkins <[email protected]>
  • Loading branch information
wawryk authored and tomzawadzki committed Aug 10, 2021
1 parent 24bfe0d commit 2f5c602
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ assignees: ''

---

# Bug report

<!--- Provide a general summary of the issue in the Title above -->

## Expected Behavior
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/intermittent_failure.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ assignees: ''

---

# CI Intermittent Failure

<!--- Provide a [test_name] where the issue occurred and brief description in the Title above. -->
<!--- Name of the test can be found by last occurrence of: -->
<!--- ************************************ -->
Expand Down
21 changes: 13 additions & 8 deletions scripts/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -587,16 +587,21 @@ function check_json_rpc() {
function check_markdown_format() {
local rc=0

echo -n "Checking markdown files format..."
mdl -s $rootdir/mdl_rules.rb . > mdl.log || true
if [ -s mdl.log ]; then
echo " Errors in .md files detected:"
cat mdl.log
rc=1
if hash mdl 2> /dev/null; then
echo -n "Checking markdown files format..."
mdl -g -s $rootdir/mdl_rules.rb . > mdl.log || true
if [ -s mdl.log ]; then
echo " Errors in .md files detected:"
cat mdl.log
rc=1
else
echo " OK"
fi
rm -f mdl.log
else
echo " OK"
echo "You do not have markdownlint installed so .md files not being checked!"
fi
rm -f mdl.log

return $rc
}

Expand Down

0 comments on commit 2f5c602

Please sign in to comment.