Skip to content
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

Migrated the Ruby Linter to NodeJS Linter #16316

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"default": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this turn off the default rules? Wouldn't we want them on?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this will turn off the default rules , no turning them on is not a good way because all the rules will be applied by default which is used by the linter and we dont want them right?We will explicitly define the rules which we want to use to lint our markdown files.

"MD002": { "level": 2 },
"MD007": false,
"MD013": false,
"MD026": { "punctuation": ".,;:!" },
"MD014": false,
"MD030": false,
"MD032": false,
"MD033": false,
"MD041": false,
"MD046": false
}
12 changes: 0 additions & 12 deletions mdl.rb

This file was deleted.

6 changes: 4 additions & 2 deletions scripts/lint_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ check_content() {
# create a throwaway copy of the content
cp -R "${DIR}" "${TMP}"
cp .spelling "${TMP}"
cp mdl.rb "${TMP}"
cp .markdownlint.json "${TMP}"

# replace the {{< text >}} shortcodes with ```plain
find "${TMP}" -type f -name \*.md -exec sed -E -i "s/\\{\\{< text .*>\}\}/\`\`\`plain/g" {} ";"
Expand Down Expand Up @@ -83,10 +83,12 @@ check_content() {
FAILED=1
fi

if ! mdl --ignore-front-matter --style mdl.rb .; then
if ! markdownlint-cli2 --config .markdownlint.json "**/*.md"; then
FAILED=1
fi



if grep -nrP --include "*.md" -e "\(https://istio.io/(?!v[0-9]\.[0-9]/|archive/)" .; then
error "Ensure markdown content uses relative references to istio.io"
FAILED=1
Expand Down