From 2f5c602574a98ede645991abe279a96e19c50196 Mon Sep 17 00:00:00 2001 From: wawryk Date: Thu, 5 Aug 2021 10:41:23 +0200 Subject: [PATCH] markdownlint: add -g option to check_format and fix mdl errors -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 Change-Id: Ib6e1920774ffca81e62d9abebc8d8b4548feb519 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9086 Community-CI: Broadcom CI Reviewed-by: Paul Luse Reviewed-by: Jim Harris Reviewed-by: Monica Kenguva Reviewed-by: Aleksey Marchuk Reviewed-by: Tomasz Zawadzki Reviewed-by: Pawel Piatek Tested-by: SPDK CI Jenkins --- .github/ISSUE_TEMPLATE/bug_report.md | 2 ++ .../ISSUE_TEMPLATE/intermittent_failure.md | 2 ++ scripts/check_format.sh | 21 ++++++++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 17ef86497..775cac437 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,6 +7,8 @@ assignees: '' --- +# Bug report + ## Expected Behavior diff --git a/.github/ISSUE_TEMPLATE/intermittent_failure.md b/.github/ISSUE_TEMPLATE/intermittent_failure.md index 4bc51adf2..dd21f8ebc 100644 --- a/.github/ISSUE_TEMPLATE/intermittent_failure.md +++ b/.github/ISSUE_TEMPLATE/intermittent_failure.md @@ -7,6 +7,8 @@ assignees: '' --- +# CI Intermittent Failure + diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 4617d7c56..2236d005d 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -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 }