-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooling for markdown linting #19425
base: main
Are you sure you want to change the base?
Tooling for markdown linting #19425
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Zanda256 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @Zanda256. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
The script runs markdown lint on newly created markdown files, or modified lines in old files. Signed-off-by: Sekiranda Hamza sekirandahamza@gmail.com Signed-off-by: Sekiranda <sekirandahamza@gmail.com>
Signed-off-by: Sekiranda Hamza sekirandahamza@gmail.com Signed-off-by: Sekiranda <sekirandahamza@gmail.com>
f65e917
to
ea90940
Compare
Signed-off-by: Sekiranda <sekirandahamza@gmail.com>
/ok-to-test |
@ivanvc could we please give the failing tests a re-run? |
Yes, you can also do it by yourself by commenting: /retest Note: I haven't forgotten about this pull request, but I haven't been able to review it as I have other things in my backlog. I'll return to this soon ✌️ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted filessee 29 files with indirect coverage changes @@ Coverage Diff @@
## main #19425 +/- ##
==========================================
- Coverage 68.97% 68.90% -0.08%
==========================================
Files 420 420
Lines 35753 35762 +9
==========================================
- Hits 24662 24641 -21
- Misses 9664 9701 +37
+ Partials 1427 1420 -7 Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request, @Zanda256. I'm sorry for not getting back to you sooner. I left a couple of comments/suggestions. Thanks again :)
scripts/markdown_diff_lint.sh
Outdated
COLOR_RED='\033[0;31m' | ||
COLOR_BOLD='\033[1m' | ||
COLOR_ORANGE='\033[0;33m' | ||
COLOR_NONE='\033[0m' # No Color | ||
|
||
function log_error { | ||
echo -n -e "${COLOR_BOLD}${COLOR_RED}$*${COLOR_NONE}\n" | ||
} | ||
|
||
function log_warning { | ||
echo -n -e "${COLOR_ORANGE}$*${COLOR_NONE}\n" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can benefit from sourcing scripts/test_lib.sh
, which defines these functions and color codes. Therefore, we can remove these definitions.
Makefile
Outdated
|
||
.PHONY: markdown-diff-lint | ||
markdown-diff-lint: | ||
./scripts/markdown_diff_lint.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we keep the linebreak in the last line of the file?
scripts/markdown_diff_lint.sh
Outdated
done | ||
if [ "${#files_with_failures[@]}" -gt "0" ]; then | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we keep the linebreak in the last line of the file?
echo "markdownlint-cli2 needs to be installed." | ||
echo "Please refer to https://github.com/DavidAnson/markdownlint-cli2?tab=readme-ov-file#install for installation instructions." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we source test_lib.sh
. These two lines can be changed to log_errror ...
.
Signed-off-by: Sekiranda <sekirandahamza@gmail.com>
With this pull request, we add a bash script to run linting check on modified or newly added markdown files. We then add a makefile target to run the script using make.
Partially resolves #18059